Long Polling Devman's Service Tasks Checking Client

Many generations of students have taken courses on programming in Devman. And they liked everything, except for one thing: there were no notifications about checked tasks. To find out the status of my work, you had to go to the site - it is inconvenient and somehow ineffective.

Devman takes care of the students. Therefore, upon learning about such a problem, they made a special service where you can send your request. And quickly get the status of the task in response to “has my work already been checked?”.

This script is a client of the service.

How to install

Download code:

git clone https://github.com/AmatorAVG/BotDevmanCheck2.git

Go to the project directory:

cd BotDevmanCheck2

In the project directory create virtual environment:

python -m venv venv

Activate it:

  • Windows: .\venv\Scripts\activate
  • MacOS/Linux: source venv/bin/activate

Install dependencies in virtual environment:

pip install -r requirements.txt

In the project directory create a file .env containing:

  • DEVMAN_ACCESS_TOKEN — API personal token, which you can get on Devman site.
  • TELEGRAM_ACCESS_TOKEN — Telegram Bot API key, received by you after registering the bot at Bot Father.
  • TELEGRAM_CHAT_ID — To obtain your chat_id, text in Telegram to special bot: @userinfobot.

Start the script:

python main.py

How to deploy

Register on Heroku site and create an app.

Link your GitHub account to Heroku and press Deploy Branch on the Deploy tab.

Create Procfile and enable it on the Resources tab:

bot python3 main.py

Fill in the Config Vars previously specified in the .env file in the Settings tab.

How to run locally with Docker

In the directory with your .env file:

docker run --env-file ./.env -d --name bot_cont amatoravg/bot-devman-check

Project Goals

The code is written for educational purposes on online-course for web-developers dvmn.org.