即使我已經加入消費者鍵時,在配置密鑰我得到的401錯誤。但是,同樣的配置文件是工作好以下401錯誤創建twitterstream
TwitterFactory twitterFactory = new TwitterFactory(configuration);
Twitter twitterClient = twitterFactory.getInstance();
,但不工作的
TwitterStreamFactory twitterStreamFactory = new TwitterStreamFactory(configuration);
TwitterStream twitterStreamClient = twitterStreamFactory.getInstance();
FilterQuery filterQuery = new FilterQuery(followersId);
twitterStreamClient.addListener(statusListener);
twitterStreamClient.filter(filterQuery);
我得到了錯誤的
[Twitter Stream consumer-1[Establishing connection]] INFO - 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.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Error 401 Unauthorized</title>
</head>
<body>
<h2>HTTP ERROR: 401</h2>
<p>Problem accessing '/1.1/statuses/filter.json'. Reason:
<pre> Unauthorized</pre>
</body>
</html>
當我打印的System.out.println(twitterStreamClient.getOAuthAccessToken().getTokenSecret());
它顯示了祕密的祕密價值。我對此感到困惑。任何人都可以幫助我?