rohitanil / cowin-slot-tracker

Tracker to check the covid shot slot availability in India and send mobile alerts via Telegram Bot.
MIT License
27 stars 19 forks source link
coronavirus covid-19 docker india python3 realtime-messaging telegram telegram-bot vacc vaccination

Cowin-Slot-Tracker

Tracker to check the covid vaccine slot availability in your district and send mobile notifications through Telegram.

Requirements

Python 3.0+ or Docker must be installed in the local system.

How to use?

There are two parts to this system

  1. Pinging the public COWIN API to get district wise data and checking for availability, every 15 minutes.
  2. Relaying this information to the user's mobile via Telegram Bot.
    • For that, you need to create a bot. Follow this tutorial to create a telegram bot. Refer the How to Create a New Bot for Telegram section. Note the TOKEN.
    • Now, open Telegram App and type @Get_Channel_User_Telegram_ID_Bot, and go to the chat. Type something and this should help you get your Telegram ID, which is your chat id. Note that as well.
    • After successfully completing the above steps, you are good to go.

Once all the above requirements are met, do the following

  1. Git clone this repository(if you are techie enough), otherwise download the repository by clicking on Download ZIP under Code.
  2. Open Terminal and change your directory to the folder you have just cloned/ downloaded. (Remember to extract the .zip file if you have downloaded it)
  3. Modify settings.json with your settings.
  4. If you are going the Docker way, make sure Docker Desktop is running.
    • Run docker build -t covin --rm .
    • Run docker run -it --name covin-schedule --rm covin
    • If you want to change settings.json, rebuild the image and run Step 4
  5. If you have Python already installed on your system,
    • Run pip install -r requirements.txt
    • Run python covin_slot_tracker.py
  6. If there is a slot available in the district id or pincode you have provided, you will receive an SMS on your phone.

Example Response

You can either use pincode or districtId.

Sample settings.json with pincode

{
  "pincode": "695013",
  "authToken": "1602################",
  "chatId" : "71############",
  "userAge": "45"
}

Sample settings.json with districtId

{
  "districtId": "391",
  "authToken": "1602################",
  "chatId" : "71############",
  "userAge": "45"
}

Response

Slots Available at 16 places.
SAKUR RH 2, Samsherpur RH, NIRAMAY HOSPITAL, Rahata RH, Chichondi Patil RH, Sakur RH, WAMBORI RH 2, 
Wambori RH, JAMKHED RH 2, Topkhana HP, Rajur RH, SHRIRAMPUR RH 2, CHICHONDI PATIL RH 2, TAKALI DHOKESHWAR RH 2, 
RAJUR RH 2, SAMSHERPUR RH 2

Here 391 is the district id for Ahmednagar, Maharashtra

Sample District Codes in Kerala

Other States

To find District ID for other states:

Got to Cowin Portal in the browser