Question

I need to print the ids of users that have re-tweeted a tweet. when I run my code, this is what I get. what am I doing wrong?

reqs()

[]

[]

[]

[]

[]

[]

[]

[]

[]

[]

[]

[]

[]

[]

[]

Traceback (most recent call last): File "", line 1, in reqs() File "C:\Documents and Settings\visolank\Desktop\Python\programs\twitter_travel_guard.py", line 136, in reqs retweets = t.statuses.retweets_of_me(since_id=str(tweet['id']), max_id=str(tweet['id'])) File "C:\Documents and Settings\visolank\Desktop\Python\programs\twitter\api.py", line 204, in call return self._handle_response(req, uri, arg_data, _timeout) File "C:\Documents and Settings\visolank\Desktop\Python\programs\twitter\api.py", line 235, in _handle_response raise TwitterHTTPError(e, uri, self.format, arg_data) TwitterHTTPError: Twitter sent status 429 for URL: 1.1/statuses/retweets_of_me.json using parameters: (max_id=345206977242210304&oauth_consumer_key=...&oauth_nonce=...&oauth_signature_method=...&oauth_timestamp=1371498240&oauth_token=...&oauth_version=1.0&since_id=345206977242210304&oauth_signature=m...) details: {"errors":[{"message":"Rate limit exceeded","code":88}]}

code:

def reqs():
    t = Twitter(auth=OAuth('....'))
    tweets = t.statuses.user_timeline.TravelGuard()
    for tweet in tweets:
        retweets = t.statuses.retweets_of_me(since_id=str(tweet['id']), max_id=str(tweet['id']))
        print retweets
Was it helpful?

Solution 2

use retweeters

instead. boom figured it out myself

OTHER TIPS

I don't know which library you're using, but I'd say this part:

since_id=str(tweet['id']), max_id=str(tweet['id'])

is part of the problem: you're giving the since and max ids the same value so there can't be anything between those restrictions. I think you want to look for retweets of each tweet, so wouldn't you just pass the id of t into the function (not sure what the parameter is named)?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top