我使用的是Twitter4j 3.0.3版.
我试图吸引关注者ID并使用OAuth.我已经使用Twitter4j多年,并且对框架有相对丰富的经验.
然而,发生了一些奇怪的事情:我的程序运行正常,然后间歇性地抛出以下堆栈跟踪:
Exception in thread "main" 401:Authentication credentials (https://dev.twitter.com/pages/auth) were missing or incorrect. Ensure that you have set valid consumer key/secret, access token/secret, and the system clock is in sync.
{"request":"\/1.1\/followers\/ids.json?user_id=20801287&cursor=-1&include_entities=1&include_rts=1","error":"Not authorized"}
Relevant discussions can be found on the Internet at:
http://www.google.co.jp/search?q=92c30ec6 or
http://www.google.co.jp/search?q=19400604
TwitterException{exceptionCode=[92c30ec6-19400604], statusCode=401, message=null, code=-1, retryAfter=-1, rateLimitStatus=RateLimitStatusJSONImpl{remaining=6, limit=15, resetTimeInSeconds=1362898120, secondsUntilReset=890}, version=3.0.3}
at twitter4j.internal.http.HttpClientImpl.request(HttpClientImpl.java:177)
at twitter4j.internal.http.HttpClientWrapper.request(HttpClientWrapper.java:61)
at twitter4j.internal.http.HttpClientWrapper.get(HttpClientWrapper.java:89)
at twitter4j.TwitterImpl.get(TwitterImpl.java:1817)
at twitter4j.TwitterImpl.getFollowersIDs(TwitterImpl.java:400)
Run Code Online (Sandbox Code Playgroud)
它抛出以下行:
IDs ids= twitter.getFollowersIDs(id,cursor);
Run Code Online (Sandbox Code Playgroud)
上面的行执行得很好,然后没有警告失败.
注意:我正在检查速率限制,上次遇到此速率时,由以下行拉出的速率限制JSON对象是(下面):
RateLimitStatus rls=twitter.getRateLimitStatus().get("/followers/ids")
RateLimitStatusJSONImpl{remaining=7, limit=15, resetTimeInSeconds=1362898120, secondsUntilReset=890}
Run Code Online (Sandbox Code Playgroud)
我认为这可能是Twitter的间歇性事情,但现在已经持续了几天.
我从各种机器尝试过它但得到了完全相同的问题. …