在发布这个问题之前,我已经考虑了很多。我有几个关于API 的Twitter
问题。Twitter4j
我正在从 Twitter 收集用户的关注者。它运行了一段时间,然后显示错误
401:Authentication credentials ( http://dev.twitter.com/pages/auth) were missing or incorrect. Ensure that you have set valid conumer key cret, access token cret, and the system clock in in sync.
error - Timestamp out of bounds
request - /1/account erify_credentials.json?include_entities=false
Relevant discussions can be on the Internet at:
http://www.google.co.jp/search?q=6f0f59ca or
http://www.google.co.jp/search?q=3f8a87d4
TwitterException{exceptionCode=[6f0f59ca-3f8a87d4], statusCode=401, retryAfter=0, rateLimitStatus=null, version=2.2.0}
at twitter4j.internal.http.HttpClientImpl.request(HttpClientImpl.java:189)
at twitter4j.internal.http.HttpClientWrapper.request(HttpClientWrapper.java:65)
at twitter4j.internal.http.HttpClientWrapper.get(HttpClientWrapper.java:93)
at twitter4j.TwitterBaseImpl.fillInIDAndScreenName(TwitterBaseImpl.java:131)
at twitter4j.TwitterImpl.verifyCredentials(TwitterImpl.java:1150)
at com.xinlab.blueapple.twitterrobot.ConvertRobot$1.run(ConvertRobot.java:77)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
Failed to get mentions: 401:Authentication credentials ( http://dev.twitter.com/pages/auth) were missing or incorrect. Ensure that you have set valid conumer key cret, access token cret, and the system clock in in sync.
error - Timestamp out of bounds
request - /1/account erify_credentials.json?include_entities=false
我在网上看过,但没有得到正确的答案。有些人建议同步你的时钟,但没有人提到如何同步(我不知道这是不是问题,可能还有其他问题)。
凭证不能出错,因为它可以正常工作15-20 分钟。我还想告诉我,我也在使用Thread.sleep(x)
Twitter,因为 Twitter 不允许每小时请求超过 350 个查询。
因此,如果问题在于大多数用户在其他帖子中所说的时间同步,那么这与Thread.sleep(12000)
更新:我发现我得到错误的时间点是 Twitter 向其推文受保护的用户询问追随者的时间。是不是跟它有关系?