问题
I am trying to implement this into python:
https://dev.twitter.com/docs/api/1.1/get/statuses/retweeters/ids
here is what I have so far:
def reqs():
t = Twitter(auth=OAuth('...'))
tweets = t.statuses.user_timeline.snl()
How do I get the user id's of those who retweeted a single tweet from the user's timeline?
回答1:
So after you would do this
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']))
idList.append(retweets)
After this all you would have to just go through idList
, and find the ids that only appear once in the list.
回答2:
Please see my solution at this post: difficulty using twitter api command implemention in python
It does use the Twyton API, however.
回答3:
use tweeters instead. boom. figured it out on my own
t.statuses.retweets(....)
来源:https://stackoverflow.com/questions/17169832/having-difficulty-using-twitter-api-command-implemention-in-python