Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import praw
- import webbrowser
- r = praw.Reddit('OAuth testing example by u/_Daimon_ ver 0.1 see '
- 'https://praw.readthedocs.org/en/latest/'
- 'pages/oauth.html for source')
- r.set_oauth_app_info(client_id='[client id]',
- client_secret='[client secret]',
- redirect_uri='http://localhost/authorize_callback')
- url = r.get_authorize_url('uniqueKey', 'modflair', True)
- webbrowser.open(url)
- access_information = r.get_access_information('[returned code]')
- item = next(r.get_subreddit('travel').get_flair_list())
- r = praw.Reddit('OAuth testing example by u/_Daimon_ ver 0.1 see '
- 'https://praw.readthedocs.org/en/latest/'
- 'pages/oauth.html for source')
- [DEFAULT]
- # A boolean to indicate whether or not to check for package updates.
- check_for_updates=True
- # Object to kind mappings
- comment_kind=t1
- message_kind=t4
- redditor_kind=t2
- submission_kind=t3
- subreddit_kind=t5
- # The URL prefix for OAuth-related requests.
- oauth_url=https://oauth.reddit.com
- # The URL prefix for regular requests.
- reddit_url=https://www.reddit.com
- # The URL prefix for short URLs.
- short_url=https://redd.it
- [OAuth-testing]
- user_agent=USER-AGENT-HERE
- username=REDDIT-ACCOUNT-USERNAME
- password=REDDIT-ACCOUNT-PASSWORD
- client_id=REDDIT-APP-CLIENT-ID
- client_secret=REDDIT-APP-CLIENT-SECRET
Add Comment
Please, Sign In to add comment