I'm trying to get oauth working.
When I do this in one terminal. it works:
>>> import tweepy
>>> token = "IGSgAItyWhLtCaEMWaMv5w"
>>> secret = "QIU2ChnM0gSu9li9MRvSVoi72UY1JCBO4HcsrvtIA"
>>> auth = tweepy.OAuthHandler(token, secret)
>>> auth.get_authorization_url()
'http://twitter.com/oauth/authorize?
oauth_token=1Vlq6hb3Hgs0WqgzP0UIdSIXp1bpZXl9PTgryNrI'
>>> auth.get_access_token('8643199')
<tweepy.oauth.OAuthToken object at 0x1021fcb10>
>>> twitter = tweepy.API(auth)
>>> twitter.home_timeline()
<bunch of status objects>
>>> auth.request_token.key
'1Vlq6hb3Hgs0WqgzP0UIdSIXp1bpZXl9PTgryNrI'
>>> auth.request_token.secret
'9ssLyXqnzKbnRToQT4oSRUsjWIBQPfKlGGiC0Mmow'
Now I switch to another terminal and run this:
>>> import tweepy
>>> token = "IGSgAItyWhLtCaEMWaMv5w"
>>> secret = "QIU2ChnM0gSu9li9MRvSVoi72UY1JCBO4HcsrvtIA"
>>> auth = tweepy.OAuthHandler(token, secret)
>>> auth.set_request_token('1Vlq6hb3Hgs0WqgzP0UIdSIXp1bpZXl9PTgryNrI', '9ssLyXqnzKbnRToQT4oSRUsjWIBQPfKlGGiC0Mmow')
>>> auth.get_access_token("8643199")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/
lib/python2.6/site-packages/tweepy-1.5-py2.6.egg/tweepy/auth.py", line
126, in get_access_token
tweepy.error.TweepError: HTTP Error 401: Unauthorized
What am I doing wrong?
Thanks,
Pepijn de Vos