A facebook messenger bot which gives real time updates of Training and Placement portal of IIT (BHU) to the students. The bot periodically crawls the company's visit
page and sends private text messages to registered users about new companies according to their branch and course.
The bot uses Django
as backend framework for webhook, Celery
as asynchronous task manager, Redis
as message broker, Wit
as intent parser, sqlite3
as database for development on local machine and postgres
for production on heroku, python's requests
module for web crawling and Ngrok
to setup a secure tunnel to localhost for development purposes.
The bot runs three jobs (1 Web server, 1 celery worker and 1 celery beat) on two dynos of heroku. 😎
- Install required dependencies
pip install -r requirements.txt
- Make sure
redis
is >= 2.10.5, if not, runpip install celery[redis]
- Migrate db
python manage.py migrate
- Start Dev server with
python manage.py runserver
- Use ngrok with
./ngrok http 8000
- Start redis-server with
redis-server
- Run Celery workers with
celery -A tpobot worker -l info
- Run Celery beat with
celery -A tpobot beat -l info
- Your server's verify token as
VT
- FB page access token as
AT
- TPO username as
username
- TPO password as
password
- Wit access token as
wit_server_AT
- Activate python environment before running
celery