I’m using Node.js package Twit
to stream tweets and currently it’s including retweets as well but I don’t want it to. My code looks like this:
var stream = T.stream('statuses/filter', { track: '#myhashtag' });
and I’ve tried this but it didn’t work:
var stream = T.stream('statuses/filter', { track: '#myhashtag' }, '-filter:retweets');
3
Answers
The filter should be concatenated to the end of your query as shown below.
After quite a research i think the ‘-filter:retweets’ operator for query parameter has been outdated what worked for me was ‘-RT’ operator.
when the tweet is a retweet, there is an existence of retweeted_status, otherwise it is undefined. maybe this will help:
alternatively, another user proposed a function that might help:
https://github.com/ttezel/twit/issues/286#issuecomment-236315960