Improve documentation of get_secret.py

moop-is-a-faggot
David Trail 9 years ago
parent 1aeca04ad3
commit 21be32ad9b

@ -1,20 +1,18 @@
#!/usr/bin/env python #!/usr/bin/env python
''' '''
This is to get a refresh token from a private script app created through Reddit So I heard you want to use OAuth2? This is a helper tool that gets the
apps here: https://www.reddit.com/prefs/apps/ authenticaton code for you and fires it into praw.ini.
1. Create app at above URI, using the private script option How to use:
2. Enter client_id and secret into praw.ini - Visit: https://www.reddit.com/prefs/apps
3. Run this script - Create new "script", under callback URL put http://127.0.0.1:65010
4. At the prompt copy the URL and open it in your browser. Allow access to your - Open praw.ini
private app and it'll redirect you to a broken webpage. - oauth_client_id = { The ID displayed under the icon thingy }
5. Copy the code printed into your console as the oauth_refresh_token and enter - oauth_client_secret = { The secret }
t in praw.ini - oauth_redirect_uri = http://127.0.0.1:65010
6. All future requests through praw will use praw.ini to login with OAuth2 - Run this script
- Your browser will open to a page on Reddit listing requested perms
Once client/secret/refresh are in praw.ini you only have to call - Click permit
refresh_access_information() instead of get_authorize_url() ->
get_access_information().
''' '''
import praw import praw

@ -2,9 +2,12 @@
# Will be deprecated sometime in 2015 (probably) # Will be deprecated sometime in 2015 (probably)
user = user =
pswd = pswd =
# Oauth should be used instead
## OAuth2 settings:
# Client / Secret from your own app
oauth_client_id = oauth_client_id =
oauth_client_secret = oauth_client_secret =
oauth_redirect_uri = # Corresponds with the callback URL in the Reddit app
oauth_refresh_token = oauth_redirect_uri = http://127.0.0.1:65010
log_requests = 0 log_requests = 0
# After running get_secret.py you should find your auth ID below

Loading…
Cancel
Save