Created
September 21, 2018 02:45
-
-
Save empireshades/80e1901ba34dbb00571ee8bd76297445 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
from: alexis-mignon/python-flickr-api#46