Monitors a subreddit and prints a message when a new thread appears
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Subreddit Monitor

This is just a really simple script that I was testing. It will be used in a larger project.
It simply:

  1. Gets the RSS feed of multiple subreddits eg
  2. Grabs the ID of the newest thread
  3. Prints a message and performs an action when a newer thread appears
  4. Sleeps 5 seconds
  5. Repeats

This project is not pip installable


One or more subreddits can be monitored.
This is controlled via reddit_data.json. It maps a name of a subreddit to the last id that was recorded.
By default the file should be named reddit_data.json and be in the cwd.
This will be automatically rewritten when new data is found.

    "last_id": null,
    "name": "news"
    "last_id": null,
    "name": "aww"

Environment Variables

  • SUBREDDIT_MONITOR_LOG controls logging level eg DEBUG, INFO, ERROR
  • SUBREDDIT_MONITOR_SLEEP seconds to sleep before checking next subreddit eg 5, 120
  • Warning: Anything less than 5 may cause errors
  • SUBREDDIT_MONITOR_DATA absolute path to reddit data file eg /Users/

Using this project

This is just a sample project, so you should download the source code and modify it to fit your needs.
Logic is in subreddit_monitor/ and you can simply modify _on_new_entry() to get started.


Python 3.5 or 2.7