2012-07-14 62 views
3

當我搜索給定的哈希標籤時,我得到最近包含該哈希標籤的推文的結果。這就是我想要流的東西,所以如果有任何新的推文帶有這個hashtag,我會知道的。如何讓Twitter4J使用特定主題標籤流式傳輸帖子?

+0

只需使用搜索並將hashtag作爲參數? – 2012-07-14 18:51:23

+0

我需要流它們 – 2012-07-14 19:33:44

回答

4
Twitter twitter = new TwitterFactory().getInstance(); 
try { 
    QueryResult result = twitter.search(new Query("#myhashtag")); 
} catch (TwitterException te) { 
    te.printStackTrace(); 
} 

Source

您可能需要逃避#符號

+0

它是一個流嗎? – nkint 2013-07-02 11:11:19

相關問題