Akuba

Untitled

Feb 8th, 2017
320
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.66 KB | None | 0 0
  1. from imgurpython import ImgurClient
  2.  
  3. client_id = 'id here'
  4. client_secret = 'secret here'
  5. client_pin = None
  6. #client_pin = 'abcdefghjk'
  7.  
  8. client = ImgurClient(client_id, client_secret)
  9.  
  10. if client_pin:
  11.     credentials = client.authorize(client_pin, 'pin')
  12.     print (credentials['access_token'])
  13.     print (credentials['refresh_token'])
  14.     client.set_user_auth(credentials['access_token'], credentials['refresh_token'])
  15. else:
  16.     # Authorization flow, pin example (see docs for other auth types)
  17.     authorization_url = client.get_auth_url('pin')
  18.     print(authorization_url)
  19.     # ... redirect user to `authorization_url`, obtain pin (or code or token) ...
Advertisement
Comments
  • User was banned
Add Comment
Please, Sign In to add comment