转推python twitter api实现

时间:2013-06-18 15:39:24

标签: python api twitter compiler-errors implementation

使用python,如何获得转发推文的所有用户的数组。我找到了这个,但不知道如何将它实现到python中。

https://dev.twitter.com/docs/api/1.1/get/statuses/retweeters/ids

这是我试过的代码

 t = Twitter(auth=OAuth('....'))
 tweets = t.statuses.user_timeline.AIG_Latestnews()

When I try this:
pl = t.statuses.retweeters(tweets[0]['id'])

I get an error:
Traceback (most recent call last):
File "<pyshell#134>", line 1, in <module>
    reqs()
  File "C:\Documents and     Settings\visolank\Desktop\Python\programs\twitter_travel_guard.py", line 138, in reqs
pl = t.statuses.retweeters(tweets[0]['id'])
TypeError: __call__() takes exactly 1 argument (2 given)

1 个答案:

答案 0 :(得分:0)

我自己想出来了

pl = t.statuses.retweets.id(id = tw) print pl [0] ['user'] ['screen_name']