Note that there are some explanatory texts on larger screens.

plurals
  1. POFlickr OAuth from Google App Engine Python
    text
    copied!<p>I have a weird problem with Flickr OAuth on Google App Engine:</p> <p>I'm requesting for oauth token and secret from Flickr using the code attached.. it fails most of time when tested on App Engine.. Flickr returns a page saying</p> <p><strong>"Flickr has the hiccups. We're looking into the problem right now..."</strong></p> <p>At first I thought it might be the problem with Flickr.. but then if I copied the URL into chrome directly, I could get the oauth token and secret.. So I thought it could be the problem with my code fetching the URL.. but in fact, with the same piece of code, I'm also able to get token and secret at <strong>localhost</strong>..</p> <p>Now I'm really confused.. because this used to work perfectly until recently.. is there any update on App Engine dev server that might cause the problem? Please help!!!</p> <pre><code> url = "http://www.flickr.com/services/oauth/request_token" params = { "oauth_timestamp": str(int(time())), "oauth_signature_method": "HMAC-SHA1", "oauth_version": "1.0", "oauth_nonce": sha1(str(random())).hexdigest(), "oauth_callback": API_CALLBACK, "oauth_consumer_key": API_KEY, } # Setup the Consumer with the key-secret given by Flickr consumer = oauth2.Consumer(key=API_KEY, secret=API_SECRET) # Create request req = oauth2.Request(method="GET", url=url, parameters=params) # Create signature signature = oauth2.SignatureMethod_HMAC_SHA1().sign(req, consumer, None) # Add the Signature to the request req['oauth_signature'] = signature h = httplib2.Http() resp, content = h.request(req.to_url(), "GET") </code></pre> <p>Update: I changed the code a little bit, keep requesting if I don't get the token (given a max try allowed). It works... still, it is very annoying that I have to write such work-around. Would appreciate if better alternative is available!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload