redditwatcher
redditwatcher copied to clipboard
Remove requirement to supply reddit credentials
If you use the "Installed Application" oauth type, you can avoid forcing users to register their own reddit app in order to use your script. This oauth type is one of the most flexible, but it's very poorly documented by both Reddit and PRAW. It goes something like this:
- Register your redditwatcher app using the "Installed Application" type through Reddit
- Copy the application's client ID (this is a public value and can be shared) into your source code
- Set the client_secret to
None
reddit = praw.Reddit(
client_id='redditwatcher_client_id',
client_secret=None,
user_agent='redditwatcher'
)
Now anybody can run your script and no secret keys are exposed!
http://praw.readthedocs.io/en/latest/getting_started/authentication.html#installed-application
Good idea, thanks!