Folgendes läuft:
Code: Alles auswählen
Python 2.7.2+ (default, Oct 4 2011, 20:06:09)
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import tweepy
>>> TWITTER_CONSUMER_KEY = "abc-zensur"
>>> TWITTER_SECRET_KEY = "123-zensur"
>>> auth = tweepy.OAuthHandler(TWITTER_CONSUMER_KEY, TWITTER_SECRET_KEY)
>>> url = auth.get_authorization_url()
>>> url
'http://twitter.com/oauth/authorize?oauth_token=DEMO-TOKEN1'
>>> verifier = "DEMO-TOKEN2"
>>>
>>> auth.get_access_token(verifier)
<oauth.oauth.OAuthToken object at 0x7fd96da1da50>
>>> api = tweepy.API(auth)
>>> api.test()
True
>>>
Läuft nicht:
Code: Alles auswählen
Python 2.7.2+ (default, Oct 4 2011, 20:06:09)
[GCC 4.6.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import tweepy
>>> TWITTER_CONSUMER_KEY = "abc"
>>> TWITTER_SECRET_KEY = "123"
>>> auth = tweepy.OAuthHandler(TWITTER_CONSUMER_KEY, TWITTER_SECRET_KEY)
>>> url = auth.get_authorization_url()
>>> url
'http://twitter.com/oauth/authorize?oauth_token=DEMO-TOKEN1'
# In Django wird jetzt aud die URL umgeleitet.
#
>>> verifier = "DEMO-TOKEN2"
>>> auth = tweepy.OAuthHandler(TWITTER_CONSUMER_KEY, TWITTER_SECRET_KEY)
>>> auth.get_access_token(verifier)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/dist-packages/tweepy/auth.py", line 126, in get_access_token
raise TweepError(e)
tweepy.error.TweepError: HTTP Error 401: Unauthorized
>>>
Hat jemand einen Vorschlag was ich machen kann um das Problem zu umgehen?
MfG
senden9