我正在尝试在Twitter中搜索表达式,我的代码:
public static List<Status> searchQuery(Twitter twitter, String search)
throws TwitterException, IOException {
Query query = new Query(search);
query.setCount(100);
query.setSince("2015-05-25");
QueryResult result;
List<Status> tweets = null;
do {
System.out.println("Write to File ...");
result = twitter.search(query);
List<Status> newTweets = result.getTweets();
if (tweets == null) {
tweets = newTweets;
} else {
tweets.addAll(newTweets);
}
WriteToFile.writeTweetsToFile(newTweets);
} while ((query = result.nextQuery()) != null);
return tweets;
}
但它只是返回上个月的推文,当我使用query.setUntil("2015-06-25");
时没有返回任何内容。有什么问题?