Twitter search (atom) API - exclude retweets
10,960
Solution 1
I've been successfully excluding retweets by adding +exclude:retweets at the end of my search query.
Solution 2
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 :)
Author by
planIT
Updated on June 05, 2022Comments
-
planIT about 2 years
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?
-
Carcamano about 12 yearsThis seems to have the same effect as "-rt". I tried a few search strings containing RT and with +exclude:retweets they never return anything.