English 中文(简体)
页: 1
原标题:Twitter 401 Authentication Error (Does Thread.sleep() unsyncs me clock)

在提出这些问题之前,我进行了很多思考。 我有几个问题涉及<代码>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

我已经看过这个网络,但却没有获得正确答案。 有些人建议lock你,但没有人提到如何yn合(我不知道这个问题不是,可能还有其他一些问题)。

由于Credential公司为15-20 min做罚款,因此不可能是错误的。 我还要说,我也正在使用<代码>Thread.sleep(x)。 推特允许每小时提出350多个询问。

因此,如果像大多数用户在其他员额所说的那样,问题在时间上是同步的,那么与<代码”有关的事情就是这样。 校对:

最新情况:我指出,我之所以出现错误,是因为Twitter要求保护的用户追随者。 究竟是怎样做?

最佳回答

suggestion夜的建议是,请求有一个时间序列,用于在生成用于验证请求的签字时, seed算法。

签字具体针对的是提出的请求、提出该请求的人、提出该请求的申请时,以及另一种任意价值。

申请时间敏感,因此,服务(Twitter)将检查时间是否在+/时间之内。 确切的时间不为人所知,但服务应当尽可能少。

你应该利用互联网时间服务,把你的系统捆绑起来。 这里是谷歌向我提供的一条话,内容是:在lin中确定时间:

问题回答

Yes the suggestion is to check/sync your clock. I tried to do same and I kept on updating my system time(Laptop/PC). After 1Hour I came to notice that my emulator s system time was not on sync with the server. I stopped emulator and started again It worked. Also you can manually change the system time from:

  1. Settings
  2. Date and Time
  3. Untick Automatic Date and Time
  4. Set Time

希望有助于人们。

感谢你们!





相关问题
Local and remote data synchronisation

We have a local server with an access database which feeds data to clients in the same domain. Now we also have a website which is hosted externally, and working on a bridge system to provided upload/...

Write-though caching of large data sets in WCF?

We ve got a smart client that talks to a SQL Server database via WCF, displaying the entities in the database, and allowing the user to edit those entities. Some of the WCF calls return a large data ...

How are mutex and lock structures implemented?

I understand the concept of locks, mutex and other synchronization structures, but how are they implemented? Are they provided by the OS, or are these structures dependent on special CPU instructions ...

AutoResetEvent, ManualResetEvent vs Monitor

Lets say I have to orchestrate a synchronization algorithm in .Net 3.5 SP1 and any of the synchronization primitives listed in the title fit perfectly for the task. From a performance perspective, is ...

Synchronising SQL database through ADO.Net

The problem that i m having is how can i synchronise my datasets in my VS 2008 project to any changes in the database. As you know we read data from the db into the dataset which is disconnected, now ...

多线同步的明显模式? (C#)

我有两条镜子,指相同的变数——电离层和透镜。 因此,我在两条路口的24小时发言中总结了接触情况。 时间接近具有优先地位——......

热门标签