使用带有Python的twitter api,我需要知道如何获取所有转发了tweet信息的人的所有用户ID。我去了这里:https : //dev.twitter.com/docs/api/1/get/statuses/%3Aid/retweeted_by但我不知道如何将其放入python。到目前为止,这是我的代码:from twitter import *t = Twitter(auth=OAuth(....))twitter = t.statuses.user_timeline.snl()twitter[0]['text'] # gets the tweettwitter[0]['retweet_count'] # gets the number of retweets下一条要获取所有转发用户的ID的下一行是什么?
1 回答

凤凰求蛊
TA贡献1825条经验 获得超4个赞
您应该对twitter API 1.1使用retweets_of_me,retweeted_by它已被弃用并且不起作用。
这是一个例子:
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
希望能有所帮助。
添加回答
举报
0/150
提交
取消