Twitter API - how to get real time tweets by user
You should be able to pass the follow
keyword like this:
stream.filter(follow=['user_id'])
It receives a list of user IDs.
From the API
docs, this should return:
- 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”).
It doesn't return:
- Tweets mentioning the user (e.g. “Hello @twitterapi!”).
- Manual Retweets created without pressing a Retweet button (e.g. “RT @twitterapi The API is great”).
- Tweets by protected users.
Note
You can specify both track
and follow
values and it will result in tweets with the input keyword or tweets created by the input user.
Twitter API - Listen to a user's tweets in real-time
From https://dev.twitter.com/streaming/reference/post/statuses/filter
follow
A comma-separated list of user IDs, indicating the users whose Tweets should be delivered on the stream.
So, if you POST John,Paul,George,Ringo
you will get a stream which includes:
- Tweets created by the user.
- Tweets which are retweeted by the user.
- Replies to the user.
- Retweets of the user.
Get live tweets from a specific user list... getting duplicates tweepy python
Per the Twitter documentation on the follow
parameter:
follow
A comma-separated list of user IDs, indicating the users whose Tweets
should be delivered on the stream. Following protected users is not
supported. 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”).
The stream will not contain:
- Tweets mentioning the user (e.g. “Hello @twitterapi!”).
- Manual Retweets created without pressing a Retweet button (e.g. “RT
@twitterapi The API is great”).- Tweets by protected users.
When you say that "the same Tweets are being duplicated", do you mean that you're seeing the same Tweet IDs multiple times?
You also mentioned that the "Tweets are not live" but it is not clear what you mean by this.
Related Topics
Metasploit Induction of Bundle and Rake
Deleting a Line in a Text File
Ruby Selenium Web Drive: How to Find Specific Element by Xpath Div Id and CSS Class
Need Help on Join Table, Limiting Results to Only the Resource Id
Rails App Has Trouble with Inter-Model Saving
API Post with Array Using Http Gem (Or Restclient)
Linking to External File in Ruby on Rails
How to Properly Create a Associated Record Just After the Associator Record Creation
Multiple Limit Condition in Mongodb
How to Properly Install Bootsnap on Windows
Rails Undefined Method 'Errors' for Nil:Nilclass in Simple_Form
Make Map Marker Direct Link Onclick for Gmaps4Rails
Rails Strong Params - Using Fields from Has_Many Object
Ruby Stack Failed to Deploy on Google Developers Console
Hook Before All Delyed Job Success Callback to Save Successfully Completed Jobs