python - Retweeters of a Twitter status in Tweepy -


this kindof followup question this question. want id of users have retweeted particular tweet.

i tried following same technique i'm getting error. here's code:

import tweepy  auth = tweepy.oauthhandler(consumer_key, consumer_secret) auth.set_access_token(access_key, access_secret)  api = tweepy.api(auth)  firsttweet = api.user_timeline("github")[0] print firsttweet.text print firsttweet.id results = api.retweeted_by(firsttweet.id)  print results 

this returns 1st tweet , tweet id. gives me following error:

    traceback (most recent call last):   file "twitter_test.py", line 21, in <module>     results = api.retweeted_by("357237988863913984")    file "/usr/local/lib/python2.7/dist-packages/tweepy-2.1-py2.7.egg/tweepy/binder.py", line 197, in _call     return method.execute()   file "/usr/local/lib/python2.7/dist-packages/tweepy-2.1-py2.7.egg/tweepy/binder.py", line 173, in execute     raise tweeperror(error_msg, resp) tweepy.error.tweeperror: [{u'message': u'sorry, page not exist', u'code': 34}] 

retweeted_by not part of 1.1 twitter api. switch retweets:

results = api.retweets(firsttweet.id) 

fyi, quote docs:

get statuses/retweeters/ids

returns collection of 100 user ids belonging users have retweeted tweet specified id parameter.

this method offers similar data statuses/retweets/:id , replaces api v1's statuses/:id/retweeted_by/ids method.


Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -