I am using the Twitter Streaming API with Apache Storm to get the tweets and want to filter the tweets for specific keywords. I had a look at some examples i found on the internet and using the same code to filter for the keywords.
I get lots of tweets, unfortunately, the filter doesn’t seem to work at all. Here is the code i am using:
TwitterStreamFactory fact = new TwitterStreamFactory(config.build());
twitterStream = fact.getInstance();
FilterQuery tweetFilterQuery = new FilterQuery();
tweetFilterQuery.track(new String[]{"bitcoin"});
twitterStream.addListener(new TweetListener());
twitterStream.filter(tweetFilterQuery);
twitterStream.sample();
The resulting tweets are then displayed on the console.
I don’t see, why this code does not work. Any hints?
Thanks