using the twitter api with python, I need to know how to get all the user ids of all the people that retweeted a tweet.
but I do not know how to put that into python.
here is my code so far:
from twitter import * t = Twitter(auth=OAuth(....)) twitter = t.statuses.user_timeline.snl() twitter['text'] # gets the tweet twitter['retweet_count'] # gets the number of retweets
what is my next line to get the IDs of all the users who retweeted?
You should use retweets_of_me for twitter API 1.1,
retweeted_by is deprecated and doesn't work.
Here's an example:
from twitter import * t = Twitter(auth=OAuth(...)) tweets = t.statuses.user_timeline.snl() for tweet in tweets: retweets = t.statuses.retweets_of_me(since_id=str(tweet['id']), max_id=str(tweet['id'])) print retweets
Hope that helps.