TwitterError: Could not authenticate with OAuth?


#1

I setup everything successfully, but python pop some Oauth errors

====================================================================
Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win32
Type “copyright”, “credits” or “license()” for more information.

import simplejson
import httplib2
import twitter
api = twitter.Api(consumer_key=‘xxxxxxxxxxxxxxxxxxxxxxx’,consumer_secret=’ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx’,access_token_key=‘xxxxxxxxxxxxxxxxxxxxxxxxxx’,access_token_secret=‘xxxxxxxxxxxxxxxxxxxx’)
status = api.PostUpdate(‘This is just a test from my app’)
Traceback (most recent call last):
File “<pyshell#4>”, line 1, in
status = api.PostUpdate(‘This is just a test from my app’)
File “build\bdist.win32\egg\twitter.py”, line 2766, in PostUpdate
data = self._ParseAndCheckTwitter(json)
File “build\bdist.win32\egg\twitter.py”, line 3668, in _ParseAndCheckTwitter
self._CheckForTwitterError(data)
File “build\bdist.win32\egg\twitter.py”, line 3691, in _CheckForTwitterError
raise TwitterError(data[‘error’])
TwitterError: Could not authenticate with OAuth.

api.PostUpdate(“Hello world”)

Traceback (most recent call last):
File “<pyshell#5>”, line 1, in
api.PostUpdate(“Hello world”)
File “build\bdist.win32\egg\twitter.py”, line 2766, in PostUpdate
data = self._ParseAndCheckTwitter(json)
File “build\bdist.win32\egg\twitter.py”, line 3668, in _ParseAndCheckTwitter
self._CheckForTwitterError(data)
File “build\bdist.win32\egg\twitter.py”, line 3691, in _CheckForTwitterError
raise TwitterError(data[‘error’])
TwitterError: Could not authenticate with OAuth.

api.PostUpdate(“Hello world”)

Traceback (most recent call last):
File “<pyshell#6>”, line 1, in
api.PostUpdate(“Hello world”)
File “build\bdist.win32\egg\twitter.py”, line 2766, in PostUpdate
data = self._ParseAndCheckTwitter(json)
File “build\bdist.win32\egg\twitter.py”, line 3668, in _ParseAndCheckTwitter
self._CheckForTwitterError(data)
File “build\bdist.win32\egg\twitter.py”, line 3691, in _CheckForTwitterError
raise TwitterError(data[‘error’])
TwitterError: Could not authenticate with OAuth.