2

I have been trying to extract data from the Twitter API using Twython. Recently, the Twitter API changed version from v1 to v1.1. I do not understand the changes (if any) that need to made in the usage of Twython. I use Twython 2.5.5. The commands I used to use before, are suddenly not working anymore. Please help me with this transition so that I can get my work done faster. Thanks in advance.

This is the code snippet I am using:

twitter = twython.Twython(oauth_token = oauth_token, oauth_token_secret = oauth_secret, app_key = oauth_consumer_key, app_secret = oauth_consumer_secret)
twitter.getRetweets(id="123")

This is the error I am being shown:

TwythonError: 'Unauthorized: Authentication credentials were missing or incorrect. -- An error occurred processing your request.'
Jimbo
  • 25,790
  • 15
  • 86
  • 131
Satarupa Guha
  • 1,267
  • 13
  • 20
  • Welcome to Stack Overflow. Please take a look at the guidelines for asking questions: http://stackoverflow.com/questions/how-to-ask – Fls'Zen Mar 06 '13 at 18:49
  • 2
    I have added a code snippet to highlight the specifics of the problem I am facing. – Satarupa Guha Mar 06 '13 at 20:03

1 Answers1

0

I'm coming to this question way late, but if you (or anyone else) has further issues with this, I believe it's due to the OAuth verifier changes that Twitter (somewhat) recently introduced. Twython supports this in the newer versions, and we have examples:

from twython import Twython

t = Twython(app_key, app_secret, oauth_token, oauth_token_secret)
auth_tokens = t.get_authorized_tokens(oauth_verifier)
print auth_tokens
Ryan McGrath
  • 2,042
  • 14
  • 23