Giter Club home page Giter Club logo

dspsharathchandra / covid-vaccine-booking Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pallupz/covid-vaccine-booking

0.0 0.0 0.0 149.1 MB

This very basic script can be used to automate COVID-19 vaccination slot booking on India's Co-WIN Platform.

License: MIT License

Python 91.84% Batchfile 0.01% C 2.42% C++ 0.22% Tcl 4.55% Makefile 0.12% Shell 0.03% F# 0.01% C# 0.02% Forth 0.01% HTML 0.36% CSS 0.01% XSLT 0.31% Roff 0.04% DTrace 0.01% VBScript 0.01% PLSQL 0.05% PowerShell 0.04%

covid-vaccine-booking's Introduction

COVID-19 Vaccination Slot Booking Script

This very basic CLI based script can be used to automate covid vaccination slot booking on Co-WIN Platform.

If it helped you and want to appreciate me. Then do so by buying me coffee (link below). This motivates us to serve the community. Many Thanks!

Buy Me A Coffee

If you wish to create your own Buymeacoffee page then please follow this link

Usage (One Click):

For the anyone not familiar with Python and using Windows, using the native.bat would be the easiest way.

Or if you are looking for complete automation with captcha & OTP or coming from https://github.com/bombardier-gif/covid-vaccine-booking then run advanced.bat to run his version of the code. Full Documentation for this is available @ https://github.com/bombardier-gif/covid-vaccine-booking#readme

Usage (Developer Mode):

If you'are on MacOS install libtiff libjpeg webp little-cms2 before running the pip install. To install, run:

brew install libtiff libjpeg webp little-cms2

Use Python 3.9 and install all the dependencies with:

pip install -r requirements.txt

Then, run the script file as show below:

python src\covid-vaccine-slot-booking.py

If you're on Linux, MacOS install the sox package before running the Python script. To install sox, run:

sudo apt-get install sox

If you already have a bearer token, you can also use:

python src\covid-vaccine-slot-booking.py --token=YOUR-TOKEN-HERE

Steps:

  1. Run script: python src\covid-vaccine-slot-booking.py

  2. Select Beneficiaries. Read the important notes. You can select multiple beneficiaries by providing comma-separated index values such as 1,2:

    Enter the registered mobile number: ██████████
    Requesting OTP with mobile number ██████████..  
    Enter OTP: 999999  
    Validating OTP..  
    Token Generated: █████████████████████████████████████████████████████████████  
    Fetching registered beneficiaries..  
    +-------+----------------------------+---------------------------+------------+  
    | idx   | beneficiary_reference_id   | name                      | vaccine    |  
    +=======+============================+===========================+============+  
    | 1     | ██████████████             | █████████████████████████ | COVISHIELD |  
    +-------+----------------------------+---------------------------+------------+  
    | 2     | ██████████████             | █████████████████         |            |  
    +-------+----------------------------+---------------------------+------------+  
      
    ################# IMPORTANT NOTES #################  
    # 1. While selecting beneficiaries, make sure that selected beneficiaries are all taking the same dose: either first OR second.  
    # Please do no try to club together booking for first dose for one beneficiary and second dose for another beneficiary.  
    #  
    # 2. While selecting beneficiaries, also make sure that beneficiaries selected for second dose are all taking the same vaccine: COVISHIELD OR COVAXIN.  
    # Please do no try to club together booking for beneficiary taking COVISHIELD with beneficiary taking COVAXIN.  
    ###################################################  
      
    Enter comma separated index numbers of beneficiaries to book for : 2
    
  3. Ensure correct beneficiaries are getting selected:

    Selected beneficiaries:  
    +-------+----------------------------+-----------+  
    | idx   | beneficiary_reference_id   | vaccine   |  
    +=======+============================+===========+  
    | 1     | ██████████████             |           |  
    +-------+----------------------------+-----------+
    
  4. Select a state

    +-------+-----------------------------+  
    | idx   | state                       |  
    +=======+=============================+  
    | 1     | Andaman and Nicobar Islands |  
    +-------+-----------------------------+  
    | 2     | Andhra Pradesh              |  
    +-------+-----------------------------+
    +-------+-----------------------------+
    +-------+-----------------------------+  
    | 35    | Uttar Pradesh               |  
    +-------+-----------------------------+  
    | 36    | Uttarakhand                 |  
    +-------+-----------------------------+  
    | 37    | West Bengal                 |  
    +-------+-----------------------------+
    
    Enter State index: 18
    
  5. Select districts you are interested in. Multiple districts can be selected by providing comma-separated index values

    +-------+--------------------+  
    | idx   | district           |  
    +=======+====================+  
    | 1     | Alappuzha          |  
    +-------+--------------------+  
    | 2     | Ernakulam          |  
    +-------+--------------------+  
    | 3     | Idukki             |  
    +-------+--------------------+
    +-------+--------------------+
    +-------+--------------------+  
    | 13    | Thrissur           |  
    +-------+--------------------+  
    | 14    | Wayanad            |  
    +-------+--------------------+
    
    Enter comma separated index numbers of districts to monitor : 2,13
    
  6. Ensure correct districts are getting selected.

    Selected districts:  
    +-------+---------------+-----------------+-----------------------+  
    | idx   | district_id   | district_name   | district_alert_freq   |  
    +=======+===============+=================+=======================+  
    | 1     | 307           | Ernakulam       | 660                   |  
    +-------+---------------+-----------------+-----------------------+  
    | 2     | 303           | Thrissur        | 3080                  |  
    +-------+---------------+-----------------+-----------------------+
    
  7. Enter the minimum number of slots to be available at the center:

    Filter out centers with availability less than: 5
    
  8. Script will now start to monitor slots in these districts every 15 seconds.

    ===================================================================================  
    Centers available in Ernakulam from 01-05-2021 as of 2021-04-30 15:13:44: 0  
    Centers available in Thrissur from 01-05-2021 as of 2021-04-30 15:13:44: 0  
    No viable options. Waiting for next update in 15s.
    ===================================================================================  
    Centers available in Ernakulam from 01-05-2021 as of 2021-04-30 15:13:59: 0  
    Centers available in Thrissur from 01-05-2021 as of 2021-04-30 15:13:59: 0  
    No viable options. Waiting for next update in 15s.
    
  9. If at any stage your token becomes invalid, the script will make a beep and prompt for y or n. If you'd like to continue, provide y and proceed to allow using same mobile number

    Token is INVALID.  
    Try for a new Token? (y/n): y
    Try for OTP with mobile number ███████████? (y/n) : y
    Enter OTP: 888888
    
  10. When a center with more than minimum number of slots is available, the script will make a beep sound - different frequency for different district. It will then display the available options as table:

    ===================================================================================  
    Centers available in Ernakulam from 01-05-2021 as of 2021-04-30 15:34:19: 1  
    Centers available in Thrissur from 01-05-2021 as of 2021-04-30 15:34:19: 0  
    +-------+----------------+------------+-------------+------------+------------------------------------------------------------------------------+  
    | idx   | name           | district   | available   | date       | slots                                                                        |  
    +=======+================+============+=============+============+==============================================================================+  
    | 1     | Ayyampilly PHC | Ernakulam  | 30          | 01-05-2021 | ['09:00AM-10:00AM', '10:00AM-11:00AM', '11:00AM-12:00PM', '12:00PM-02:00PM'] |  
    +-------+----------------+------------+-------------+------------+------------------------------------------------------------------------------+  
    ---------->  Wait 10 seconds for updated options OR  
    ---------->  Enter a choice e.g: 1.4 for (1st center 4th slot): 1.3
    
  11. Before the next update, you'll have 10 seconds to provide a choice in the format centerIndex.slotIndex eg: The input1.4 will select the vaccination center in second row and its fourth slot.

Important:

  • This is a proof of concept project. I do NOT endorse or condone, in any shape or form, automating any monitoring/booking tasks. Use at your own risk. Seriously, if you get into legal trouble for using this, I am not liable.
  • This CANNOT book slot automatically. You will need to enter the OTP and Captcha.
  • Do NOT use unless all the beneficiaries selected are supposed to get the same vaccine and dose.
  • There is no option to register new mobile or add beneficiaries. This can be used only after beneficiary has been added through the official app/site.
  • Be careful if you choose to use the auto-book feature. It will blindly select first available center, date - both sorted ascending - and a RANDOM slot. I would recommend against using this. Only added for the convenience of people in short supply areas.
  • If you accidentally book a slot, don't worry. You can always login to the official portal and cancel that. There will be an X symbol on the right-top corner for each beneficiary.
  • API Details (read the first paragraph at least): https://apisetu.gov.in/public/marketplace/api/cowin/cowin-public-v2
  • And finally, I know code quality isn't great. Suggestions are welcome.

covid-vaccine-booking's People

Contributors

pallupz avatar vishalv26 avatar github-actions[bot] avatar actions-user avatar aneeska avatar daggy1234 avatar dhimil avatar mrehanms avatar sparshsinghaltw avatar sparshsinghal 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.