Twitter status Tweety Retweeters

This is a question about the next question this question . I want to get the ID of users who renamed a particular tweet.

I tried to follow the same technique, but I get an error message. Here is the 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 the 1st tweet as well as the tweet id. Then it raises the 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, that page does not exist', u'code': 34}] 
+4
source share
1 answer

retweeted_by not part of twitter API 1.1. Switch to retweets :

 results = api.retweets(firstTweet.id) 

FYI, quote from docs :

GET / retweeters / ids statuses

Returns a collection of up to 100 user identifiers belonging to users who have processed the tweet specified by the id parameter.

This method offers similar data for the GET / retweets /: id statuses and replaces the API v1 GET statuses /: id / retweeted_by / ids method.

+5
source

Source: https://habr.com/ru/post/1492094/


All Articles