简体   繁体   中英

Twitter streaming API in Java with tracks that have spaces?

Two Java libraries to connect to the Twitter streaming API are twitter4j and tweetstream4j .

The Twitter streaming API allows "tracks" with spaces :

Comma separated keywords and phrases are logical ORs, phrases are logical ANDs. Words within phrases are delimited by spaces. A tweet matches if any phrase matches. A phrase matches if all of the words are present in the tweet. (eg 'the twitter' is the AND twitter, and 'the,twitter' is the OR twitter.).

However, trying to use tracks with spaces in twitter4j causes an error (401 unauthorized). tweetstream4j also throws a 401 when using tracks with spaces.

Has anyone used a Java library to connect to the Twitter streaming API and used tracks with spaces? Which library and version?

Yusuke 声称已为twitter4j 2.1.7 修复了此问题

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM