Twitter转推用户ID api python

使用带有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 tweet

twitter[0]['retweet_count']  # gets the number of retweets

下一条要获取所有转发用户的ID的下一行是什么?


弑天下
浏览 162回答 1
1回答

凤凰求蛊

您应该对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希望能有所帮助。
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Python