0
我需要以特定語言(大約1000)獲得20多條推文,但使用以下代碼我只能獲得15-20條推文。誰能幫我?如何以特定語言獲得20k推文
public static void main(String[] args) throws TwitterException {
ConfigurationBuilder cb = new ConfigurationBuilder();
cb.setDebugEnabled(true)
.setJSONStoreEnabled(true)
.setDebugEnabled(true)
.setOAuthConsumerKey("*********")
.setOAuthConsumerSecret("*******")
.setOAuthAccessToken("********")
.setOAuthAccessTokenSecret("****");
TwitterFactory twitterFactory = new TwitterFactory(cb.build());
twitter4j.Twitter twitterClient = twitterFactory.getInstance();
final ResponseList<Status> homeTimelineStatuses = twitterClient.getHomeTimeline();
for (final Status status : homeTimelineStatuses) {
final String lang = status.getLang();
final String rawText = status.getText();
if (lang.equals("en")) {
System.out.println("^^ " + rawText);
} else {
System.out.println("not en");
}
}
}