twit
twit copied to clipboard
how to exclude retweets from the streaming api
I know there has been a similar question for the REST api.
Seems to be same solution proposed in this stackoverflow answer: http://stackoverflow.com/questions/38208493/twitter-api-exclude-retweets-in-stream
However, like the user who posted the question says in the comments, it doesn't seem to work as I don't receive any tweets after applying it.
I made sure I was using very popular track terms
NOTE: because this is sort of a trivial need, it would be great if the actual solution was added to the Read.ME
@jgamedev I was looking for a similar solution, and wrote a simple function to help out. Basically, if the tweet picked up in the stream is anything other than a basic tweet (i.e. a retweet, reply, etc), it returns true.
function isReply(tweet) {
if ( tweet.retweeted_status
|| tweet.in_reply_to_status_id
|| tweet.in_reply_to_status_id_str
|| tweet.in_reply_to_user_id
|| tweet.in_reply_to_user_id_str
|| tweet.in_reply_to_screen_name )
return true
}
So there is still no better solution? twitter is providing no filter for the stream? why? this creates tons of useless traffic and data.
I also wish Twitter would allow filtering of the Stream API, specifically for exclude re-tweets and replies... at least re-tweets. If I am trying to do a live feed of CNN or god forbid Justin Bieber / anyone with millions of followers my server gets bombarded with 20-100 retweets per second... You can filter out in the search API, so I don't understand why it's not a trivial matter to include it in Stream API as well. It seems to be a common request and would lower overhead considerably.
So there is still no better solution? twitter is providing no filter for the stream? why? this creates tons of useless traffic and data.
Checking by 4 years later, is it known if there's a better way to filter tweets or is this solution still the only up-to-date?