我正在尝试使用Twitter4j API根据某些规则标准跟踪twitts。 当有一个规则时,API工作正常,但当我添加两个或三个规则时,我收到此错误:
420:Returned by the Search and Trends API when you are being rate limited (https://dev.twitter.com/docs/rate-limiting).
Returned by the Streaming API:
Too many login attempts in a short period of time.
Running too many copies of the same application authenticating with the same account name.
Exceeded connection limit for user
我正在使用的代码是:
// create the TwitterStream object
ConfigurationBuilder cb = new ConfigurationBuilder();
cb.setDebugEnabled(false).setOAuthConsumerKey(accountdetails.ConsumerKey)
.setOAuthConsumerSecret(accountdetails.ConsumerSecret)
.setOAuthAccessToken(accountdetails.AccessToken)
.setOAuthAccessTokenSecret(accountdetails.AccessTokenSecret)
Configuration config = cb.build();
TwitterStream twitterStream = new
TwitterStreamFactory(config).getInstance();
// create the filter
FilterQuery filter = new FilterQuery();
filter.track(trackList);
// create the Listener object
// Twitter4jListener is a class that implements the StatusListener interface
Twitter4jListener listener = new Twitter4jListener(rule);
twitterStream.addListener(listener);
twitterStream.filter(filter);
我是否错误地使用了API?或者API通常对可以并行工作的一些听众有限制?