Git Product home page Git Product logo

cowin-checker's Introduction

CoWin-Checker

I am unhappy with Bots showing only paid vaccines, so I made my hands dirty and made myself this script.

What this script does is that it uses CoWinAPI to check specific centers periodically and gives a Win10 notification if it finds any available slots.

Thanks to @backtrackbaba for CoWin API Wrapper for python

Thanks to @ms7m for providing Cross Platform Notification Module for python

How to use this script

  1. Fork This Repo and Clone it in your local computer

  2. Install dependencies

    pip install cowin
    pip install notify-py
  3. Open setup.py and do the first time setup

    1. Find your state and state_id from ./data/state_list.csv, and update state_id and state_name to match with your state.

      # first run the below command to get the list of all states and their id's
      
      cowin_fn.print_all_states()
      
      state_id = '21'             #<----
      state_name = 'Maharashtra'  #<----
    2. Find your district and district_id from ./data/district_list.csv, and update district_id and district_name to match with your district.

      # now run the below command with your state_id to get all district and their district_ids
      
      cowin_fn.print_all_district(state_id)
      
      district_id = '395'         #<----
      district_name = 'Mumbai'    #<----
    3. Uncomment the following line and run script to update ./data/center_list.csv, and consequently update the required_center_ids to match with your the centers you want the script to watch, re-comment this line again after setup

      # now run the below commented command with your district_id to get
      # all the centers pincode, center_id, and name
      
      cowin_fn.print_all_centers(district_id)
      
      # now select make your preferred list of centers to check
      specific_center_ids = {695695, 597000, 694629}                     #<---
      specific_pin_codes = {400013, 400016, 400028}                      #<---
      specific_names = {"The World Tower MCGM Parkg", "P D Hinduja 1",   #<---
                      "KOHINOOR PUB PARKING (DRIVE)"}                    #<---
  4. Now your setup is over, head over to main.py

    # now this will check for all the given centers for any available vaccine
    # slot every refresh_time_min, and will give a win10 notification,
    # if slot found
    periodic_checker.start_check(
        district_id, specific_center_ids, minimum_age=45, dose_no=2, refresh_time_min=1)
    1. Here minimum_age is the age bracket you want to search for, enter 18 for 18+ group, 30 for 30+ group, and 45 for 45+ group
    2. Here dose_no signifies 1st dose or 2nd dose, keep this 1 for first dose search, keep this 2 for second dose search
    3. Here refresh_time_min signifies the amount of minutes to wait before rechecking for available slots, please care for CoWin Servers and not give this as 0 ๐Ÿ˜…
  5. Now all the setup are over, now I suggest you to close the editor, and open terminal window, go to the folder of script and do the following

    python main.py
  6. This will run the script in the powershell window, and will ping you if there is any available vaccine slot

    • This script takes 21 MB RAM in my system. If by any chance if starts consuming abnormally high amount of RAM, close the command immediately and give me a issue ๐Ÿ˜….
    • To Stop this script, go to terminal and do Ctrl+C repeatedly till the process gets stopped (I know ๐Ÿ˜…)
    • Do not close terminal window, while this is being executed hoping that it will happen in background, Windows doesn't allows this , and will automatically close the script once powershell windows get closed. (No idea about Linux or MacOS)

Future Plans

  1. Try to website deploy/ Discord/ Telegram Bot
  2. Add GUI, or convert this to full-fledged service

cowin-checker's People

Contributors

abhiroop25902 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.