This bot notifies users of movie releases in Singapore.
This bot is currently deployed using Heroku's free plan. Add the bot to your telegram: http://t.me/sgmoviereleases_bot
The list of movies are scrapped from IMDB's website while the details of each movie are obtained using OMDb's API.
The bot checks for upcoming movie releases and updates the database every midnight. The bot also checks if there are new movie releases every morning and notifies users if so. The list of movies and users suscribed to the bot are maintained using PostgreSQL (using pycopg2 as a Python interface).
- Beautiful Soup: For web scrapping
- psycopg2: For interfacing with PostgreSQL
- Python Telegram Bot: Python wrapper for Telegram API
- pytz: For timezone definitions
- requests: For HTTP requests
- Unidecode: To deal with non-ascii characters
To install the requirements, simply use the command:
$ pip install -r requirements.txt
-
Register your bot and obtain an authorization token via BotFather
-
Set the environment variables required in your shell:
TOKEN
: Authorization token obtained from BotFatherOMDB_API_KEY
: OMDb API keyMODE
: Set to "dev" for development mode (running locally) or "prod" to production mode (Heroku deployment)DB_NAME
: Database nameDB_HOST
: Database host addressDB_PORT
: Connection port number of the databaseDB_USER
: Username used to authenticate to the databaseDATABASE_URL
: Database URL of the PostgreSQL addon on Heroku (refer to this). Required if running in production mode.PORT
: Port number to listen for the web hook. Required if running in production mode. Set to 8443 by default.HEROKU_APP_NAME
: Heroku app name. Required if running in production mode.
Note: If you are running in 'dev' mode, you must set DB_NAME, DB_HOST, DB_PORT and DB_USER to connect to the database. DATABASE_URL is only required for Heroku deployments.
-
Run the main script:
$ python3 main.py
- Add the bot to a Telegram group. Enter "/help" and follow the instructions given by the bot.
This project is licensed under the terms of the GNU General Public License v3.0.