嘿,我正在開發一個Java桌面應用程序。我必須使用twitter4j 3.0.5通過主題標籤搜索推文。我對身份驗證和搜索推文沒有任何問題,但存在一些問題: 我已經使用topsy.com測試了我的搜索結果,並且我看到我收到了很少的推文或沒有推文。像#jobbingfest有大約500微博,但我發現它空... 的intrest件事:Twitter.search(查詢)文件說twitter4j 3.0.5搜索問題
Returns tweets that match a specified query. This method calls http://search.twitter.com/search.json
該API返回JSON這樣
{"errors": [{"message": "The Twitter REST API v1 is no longer active. Please migrate to API v1.1. https://dev.twitter.com/docs/api/1.1/overview.", "code": 68}]}
我有點困惑...爲什麼我能夠得到推文,如果該資源不再可用?
我想了解這個問題,但沒辦法......我不得不在這裏寫下求救信息:p。
非常感謝! Licio。
PS。對不起,但也許我的英語不太好...
pps。檢索超過100個推文我用這樣做是正確的?
List<MioStatus> listaStatus = null;
try {
listaStatus = new ArrayList<MioStatus>();
result = twitter.search(query);
while(result.nextQuery() != null){
for (Status status : result.getTweets()) {
if(status.isRetweet()){
listaStatus.add(new MioStatus(status.getId(), true, "RT " + status.getRetweetedStatus().getText(), status.getUser(), status.getGeoLocation(), status.getRetweetCount(), status.getCreatedAt()));
}else{
listaStatus.add(new MioStatus(status.getId(), true, status.getText(), status.getUser(), status.getGeoLocation(), status.getRetweetCount(), status.getCreatedAt()));
}
}
result = twitter.search(result.nextQuery());
}
http://stackoverflow.com/questions/17887984/is-it-possible-to-get-more-than-100-tweets/25069446#25069446 請參閱第5評論它是非常有用的:) –