Guest User

Untitled

a guest
Dec 26th, 2017
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. import praw
  2. import webbrowser
  3.  
  4. r = praw.Reddit('OAuth testing example by u/_Daimon_ ver 0.1 see '
  5. 'https://praw.readthedocs.org/en/latest/'
  6. 'pages/oauth.html for source')
  7.  
  8. r.set_oauth_app_info(client_id='[client id]',
  9. client_secret='[client secret]',
  10. redirect_uri='http://localhost/authorize_callback')
  11.  
  12. url = r.get_authorize_url('uniqueKey', 'modflair', True)
  13. webbrowser.open(url)
  14.  
  15. access_information = r.get_access_information('[returned code]')
  16.  
  17. item = next(r.get_subreddit('travel').get_flair_list())
  18.  
  19. r = praw.Reddit('OAuth testing example by u/_Daimon_ ver 0.1 see '
  20. 'https://praw.readthedocs.org/en/latest/'
  21. 'pages/oauth.html for source')
  22.  
  23. [DEFAULT]
  24. # A boolean to indicate whether or not to check for package updates.
  25. check_for_updates=True
  26.  
  27. # Object to kind mappings
  28. comment_kind=t1
  29. message_kind=t4
  30. redditor_kind=t2
  31. submission_kind=t3
  32. subreddit_kind=t5
  33.  
  34. # The URL prefix for OAuth-related requests.
  35. oauth_url=https://oauth.reddit.com
  36.  
  37. # The URL prefix for regular requests.
  38. reddit_url=https://www.reddit.com
  39.  
  40. # The URL prefix for short URLs.
  41. short_url=https://redd.it
  42.  
  43. [OAuth-testing]
  44. user_agent=USER-AGENT-HERE
  45. username=REDDIT-ACCOUNT-USERNAME
  46. password=REDDIT-ACCOUNT-PASSWORD
  47. client_id=REDDIT-APP-CLIENT-ID
  48. client_secret=REDDIT-APP-CLIENT-SECRET
Add Comment
Please, Sign In to add comment