Twitter streaming API in Java with tracks that hav

2019-08-07 12:51发布

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. (e.g. ‘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?

标签: java twitter
1条回答
戒情不戒烟
2楼-- · 2019-08-07 13:48

Yusuke claims to have fixed this for twitter4j 2.1.7.

查看更多
登录 后发表回答