Skip to content
This repository has been archived by the owner on Dec 4, 2022. It is now read-only.

Almenon/reddit_episode_bot

Repository files navigation

Reddit episode bot Tests

A script that provides info and links to TV episodes. It can automatically create a comment like below:

Picking up where he left off, Bojack Horseman is now set to start filming his dream movie Secretariat.

(Summary text is covered by spoilertag until mouseover)

This repo was archived when Heroku stopped offering free server resources. Feel free to fork this project if desired, the code is pretty simple so it should work with just a bit of touch-up.

How to activate

You have to mention, reply, or message /u/the_episode_bot. If you post a thread with the correct format in the title it automatically activates. (currently limited to participating subreddits*). The bot runs during the day and sleeps during the night (Pacific Time)

Requests should be in a form similar to this:

/u/the_episode_bot Simpsons season 3 episode 2.

Regex parsing allows the bot to accept many different request formats, as well as misspellings. The show title can be automatically inferred if the subreddit corresponds to a show in the TV-related subreddits list. Note that the listing is out of date, so please message me if there is a new show to include. Also, the bot can't distinguish between different series of the same TV show. Sorry Doctor Who fans, you are out of luck.

Development

  1. Download Python 3
  2. Install packages via pip install -r requirements.txt
  3. set your omdb api key as a environment variable
  4. debug unit tests in unit_tester.py to get a feel for how the code works (also see code diagram in info folder)
  5. Run timer.py

For running bot on heroku look at the info folder

Thanks to

Contributions and constructive criticism are welcomed.