A contest bot created during Hack On Hills 2019 at NIT Hamirpur.
Working video can be viewed here.
This bot aims to make the life of competitive programmers easy. This bot helps in reminding programmers about programming contests held on various platforms like codechef, hackerearth and codeforces and the users can also command the bot to set reminders about any contest they wish to participate in.
- Python
- BeautifulSoup and Selenium (for webscraping)
- Celery (for asynchronous task queue/job queue)
- Zulip API
- FB Messenger API
- Clone this repo.
- cd into the repo.
- Create a virtual environment and cd into it
python3 -m venv hack source hack/bin/activate
- Install all requirements
pip install -r requirements.txt
- Run the command
python3 multipro.py
- In another terminal, run the command
celery -A celery_tasks worker -l info
- Join the zulip org here and private message to @ContestBot with the commands given below to get the desired info.
- Create a fb page and an ngrok server and enter the ngrok address at messenger api settings, also enter the messenger api key to messenger.py file, then PM the fb page created with the commands given below to get the desired info.
- Show all upcoming contests
show all
- Show codeforces contests
show cf/codeforces
- Show hackerearth contests
show he/hackerearth
- Show codechef contests
show cc/codechef
- Set Reminder after a query for some index number
set reminder for index_number
ContestBot can do a variety of things related to online competitive programming contests and make the life of coders easy. Some of them are-
- Lookup contests on various websites and provide it to the user.
- Show time remaining for all the contests, listed platform-wise.
- Users can set reminders for any contest they wish to participate in.
- ContestBot runs a web-scraping job (scrapper.py) every 6 hours, to fetch contest related details from platforms like Codechef, Hackerearth and Codeforces and then stores it in the backend. This is done using Selenium (for dynamic pages like Codeforces) and BeautifulSoup (for static pages like Codechef).
- The main process (process.py) runs on the server and listens to responses from Zulip/ FB Messenger, then DialogFlow processes the message to get the relevant response, which contains the contest info from the backend.
Clone the repo and feel free to send any Pull Requests that you feel to be contructive.