I am currently using the Twitter API to retrieve tweets made by certain users. For the sake of this question, we will use @justinbieber as an example.
When using the https://stream.twitter.com/1.1/statuses/filter.json resource, setting follow to the required user ID (@justinbieber = 27260086), and allowing it to run, while I would only expect @justinbieber's tweets, I end up getting the tweets made to him from his millions of fans. Obviously this means I get way more information than I wanted, and from what I've found, I sometimes end up missing the user's own tweets!
I have tried changing each of the parameters on https://dev.twitter.com/docs/streaming-apis/parameters to no avail.
The follow parameter states:
For each user specified, the stream will contain:
Tweets created by the user.
Tweets which are retweeted by the user.
Replies to any Tweet created by the user.
Retweets of any Tweet created by the user.
Manual replies, created without pressing a reply button (e.g. “@twitterapi I agree”).
As it's in the docs, I would assume that there is no way to get just that user's tweets without having to filter the results myself (which, as specified before, means I may end up missing the user's own tweets anyway!), but I would love to know if someone knows a way around it.
Before anyone suggests using something such as statuses/user_timeline instead, I know it is able to do what I want, however it has 2 drawbacks that keep me on the streaming API:
- Each request means I lose a request, and since Twitter is rate limited, I would like to avoid this.
- Each request has the costly overheads of the HTTP protocol. Too much time is spent negotiating.
Is what I want to do possible? @justinbieber is simply an example of a high overhead Twitter account. I want to use this code to retrieve tweets of many high overhead accounts, thus speed, and the ability to see every tweet from each user are requirements.