Is that Python? Anyway, not relevant.

1. You aren't signing using the proper url.
2. You aren't using anything related to the signature on the request (req).


On 6/6/11 4:43 PM, Correa Denzil wrote:

I am performing OAuth to sign my requests. I am not developing a web
app. I am trying to harvest some user data. Here's what I do :

import oauth2 as oauth
import time

CONSUMER_KEY = 'xxxxxxxxxxxxxx'
CONSUMER_SECRET = 'xxxxxxxxxxxxxx'
access_key = 'xxxxxxxxxx'
access_secret_key = 'xxxxxxxxxxxxxxxxxxx'

consumer = oauth.Consumer(CONSUMER_KEY, CONSUMER_SECRET)
token = oauth.Token(access_key, access_secret_key)

client = oauth.Client(consumer)

# Set the API end point
url = ''

params = {'oauth_version': "1.0",
           'oauth_nonce': oauth.generate_nonce(),
           'oauth_timestamp': int(time.time()),
           'oauth_token': access_key,
           'oauth_consumer_key': consumer.key,
           'screen_name' : 'denzil_correa'

req = oauth.Request(method="GET", url=url, parameters=params)

# Sign the request.
signature_method = oauth.SignatureMethod_HMAC_SHA1()
req.sign_request(signature_method, consumer, token)

### Make the auth request ###

test = ''

resp, content = client.request(test, "GET")

print resp
print content # prints 'ok'

Here's  the output:

{"reset_time":"Mon Jun 06 14:54:50 +0000

Am I missing something?


Twitter developer documentation and resources:
API updates via Twitter:
Issues/Enhancements Tracker:
Change your membership to this group:!forum/twitter-development-talk

Reply via email to