How to exclude my retweeted tweets from results fetched through SEARCH API

udaythanks
@udaythanks Uday Kumar

Hi,

I'm using 'search API' to fetch tweets of multiple user. But the issue is the Result i am getting also includes my Retweeted Tweets.
Is there any way by which I exclude my retweeted tweets and get result for all other tweets.

A help in this regard will be appreciated.

thanks

22 weeks 6 days ago

Replies

episod
@episod Taylor Singletary

It's best to post-filter and remove the retweets from your results after you've fetched them. Alternately, you can likely remove a good amount of them by disincluding the phrase "RT" from your query: ?q=terms%20-RT

22 weeks 6 days ago
udaythanks
@udaythanks Uday Kumar

Thanks for reply,

I am sending request this type:
"http://search.twitter.com/search.json?q=".$usernamelist."&rpp=20&show_user=false&include_entities=true"

where $usernamelist = from:udaythanks+OR+from:AKParivartan+OR+from:DashingMaddy

Now with this request getting 20 tweets including my retweeted tweets. If I am using locally filter. After that the number of tweet decrease to 20 and show only 10 to 15 tweets after excluding my retweeted tweets.

So, there any way by which I exclude my retweeted tweets and get result for all other tweets account to my "rpp=20".

A help in this regard will be appreciated.

thanks

22 weeks 2 days ago
episod
@episod Taylor Singletary

If your query is such that you're looking for tweets from a specific list of users, using the GET statuses/user_timeline for each user would be far more appropriate. Otherwise, build a Twitter list of the users and then request that as a timeline instead.

In either approach, it's probably best to receive the retweets and simply filter them out after the fact.

22 weeks 2 days ago
ijili
@ijili iji.li

We are also not interested in RTs. To collect all tweets by our targeted users - actually, all users followed by our main account - we still use statuses/friends_timeline although, as clearly stated in the doc, this method is now replaced by statuses/home_timeline which has an optional include_rts parameter.

If that is correct, why do you recommend receiving and then filtering out the RTs?

22 weeks 2 days ago
udaythanks
@udaythanks Uday Kumar

Thanks for quick reply,

If using the GET statuses/user_timeline for each user then number of request increases after that IP blocked and I don't want to use Twitter list, If any method to get tweet with search or other API with single request.

A help in this regard will be appreciated.

thanks

22 weeks 2 days ago
episod
@episod Taylor Singletary

Rate limiting is a fact of life and I recommend embracing it rather than trying to work around it. Use OAuth to have better control over your rate limiting. At the end of the day, the only canonical source for specific user's tweets is going to be in the REST API's user timeline methods, not the search API.

22 weeks 2 days ago
racesas
@racesas Rafael Cesar

Use:

"http://search.twitter.com/search.json?q=".$usernamelist."+exclude:retweets&rpp=20&show_user=false&include_entities=true"

21 weeks 6 days ago