Note: this example uses a custom Python install at #!/usr/local/bin/python2.7. Edit this location on line 1 of the script to match your Python binary.
A simple example of how to scan Reddit's comments (in /r/all) for keywords using PRAW, send an e-mail when a comment is found, and add the results to a log file.
To use:
-
Set up an app on Reddit here https://www.reddit.com/prefs/apps/. Hit Create App.
-
Put the client id (red box below) in praw.ini as client_id, and client secret (blue box below) in praw.ini as client_secret.
-
Edit the config.py file to set up an SMTP server with which to send mail, as well as who the mail should be sent to and from.
-
Run.
