Skip to content

Instantly share code, notes, and snippets.

@empireshades
Created September 21, 2018 02:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save empireshades/80e1901ba34dbb00571ee8bd76297445 to your computer and use it in GitHub Desktop.
Save empireshades/80e1901ba34dbb00571ee8bd76297445 to your computer and use it in GitHub Desktop.
Hi,
Just a snippet of code to demonstrate the solution to people who arrive here and are still scratching their heads:
import flickr_api
flickr_api.set_keys(api_key = 'my_api_key', api_secret = 'my_secret')
a = flickr_api.auth.AuthHandler()
url = a.get_authorization_url("read")
print url
verifier = raw_input("Verifier code: ")
a.set_verifier(verifier)
a.save("flickr_credentials.dat")
Run the code.
Paste the displayed URL into a browser and accept the permission request.
Copy the oauth_verifier field and paste it into the terminal at the "Verifier code: " prompt.
This should result in the creation of the flickr_credentials.dat credential file which can be used like this:
import flickr_api
flickr_api.set_keys(api_key = 'my_api_key', api_secret = 'my_secret')
flickr_api.set_auth_handler("flickr_credentials.dat")
user = flickr_api.test.login()
print user.getPhotosets()
Hope this helps.
@empireshades
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment