开发者

Problem with id tweet, when tweet has been delete (Jtwitter)

My code is:

for(int i=0;i<listTweetId.size();i++){    
     if((status = twitter.getStatus(listTweetId.get(i)))!=null){
      ...

My problem is that exist some tweetId into listTweetId that are Id of tweets deleted and I don't know how it verify, because my if not works for this case. Finally in this case it spears a error, that is follows :

Exception in thread "main" winterwell.jt开发者_Python百科witter.TwitterException$E404: 
    Not Found HTTP/1.1 404 Not Found 
    {"error":"No status found with that ID.","request":"/1/statuses/show/112779914381492224.json?include_entities=1&"} 

P.S.: Tweets are not empty


I'm not entirely sure what your question is, but if the issue is that getting the status for a non-existent tweet throws an exception, you need to wrap that part in a try/catch to avoid dropping out of the loop.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜