开发者

Twitter4j. Making query and filtering posts by #hashtag

I am trying to integrate twitter (using Twitter4j) into my android app and I have few concerns/questions:

I want to retrieve tweets that have certain #hashtag, for example #sxbs开发者_运维技巧w2011. Here is the code that I am currently using:

Query query = new Query("#sxsw2011 since:2010-11-21");  
QueryResult result = twitter.search(query);  
for (Tweet tweet : result.getTweets())  
{  
     Log.d(TAG, tweet.getId() + " " + tweet.getFromUser() + " : " + tweet.getText());  
}

I want to put result into one of my views on my layout witch serves as conversation screen. My problem is I want to run this query every few, 4 or 5, seconds in order to get new comments. But with every search I would get all tweets that are created today. Then I would have to use tweet ID's to exclude those that are already shown on my conversation window. To me this seems wrong. Is there any other way to search for tweets and to specify some time span like few minutes? Is there better way of doing what I want? I tried to use StatusListener, but have problem trying to figure how to use getFilterStream().

What are twitter limitations. How many times my app (it will be running on multiple user devices) can request result?

The icon 101010 in editor is not working so it's sort of impossible to make correct code indentation when typing the post.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜