I am using the Atom search API from Twitter. Now I present all (newest 5) tweets with a certain word. But unfortunately, many people retweet this one post and I get the same post 5 times.
Can I exclude retweets? If so, how?
You can turn off Retweets for a specific account if you don't like what they share. Select Turn off Retweets from an account profile page to stop seeing Tweets they've Retweeted (tap the gear icon on iOS or click or tap the overflow icon on web and Android).
If you fetch tweets using the tweepy library of python then you can achieve filtering retweets by appending “ -filter:retweets” to the search query. The code will look something like this: for status in tweepy. Cursor(api.search,q=query+" -filter:retweets",lang='en',result_type='recent').
Click the Privacy and safety tab, then click Mute and block. Click Muted words. Click the plus icon. Enter the word or hashtag you'd like to mute.
I've been successfully excluding retweets by adding +exclude:retweets at the end of my search query.
I've done that and I'll share how you accomplish this. This would be your search query:
http://search.twitter.com/search.atom?lang=en&rpp=100&q=[yourpost-value]-filter:retweets
This will exclude the retweets 100% and it worked for me :). If you have a problem with this, here is the alternate way:
Concatenate -filter:retweets within the function you are calling, here is an example:
if(isset($_POST['q'])){
$q = $_POST['q']."-filter:retweets";
}
Now you just need to execute you search query:
http://search.twitter.com/search.atom?lang=en&rpp=100&q=[post-value]
I hope this helps, have fun with programming :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With