Coder Social home page Coder Social logo

srvsaha / cowinvaccineslotfinder Goto Github PK

View Code? Open in Web Editor NEW
81.0 6.0 32.0 7.64 MB

Cross-Platform Software to Fetch the Available Slots & Book the Appointment for COVID-19 Vaccination

Home Page: https://shawt.io/r/sYv

License: MIT License

C# 98.41% Shell 0.55% Python 1.02% Batchfile 0.02%
vaccine-availability cowin-vaccine-tracker vaccination-tracker cowin cowin-api covid-19 vaccine-appointments hacktoberfest hacktoberfest-accepted

cowinvaccineslotfinder's Introduction

CoWIN Vaccine Slot Finder Logo

Cross-Platform Real-Time Co-WIN Vaccine Slot Finder - We Find Your Shot!

LatestReleaseWindows LatestReleaseMacOS LatestReleaseLinux Downloads TotalBookings BookingsToday Issues MIT License

Watch Demo to See How It Works, Check Out App Statistics & Download Latest Version of the Software for your Operating System by clicking the above links or by clicking here & kindly follow the steps mentioned in How To Use and read the FAQs

NOTE: Please make sure these changes are done in Config file appsettings.json before running the Software

WATCH DEMO - How To Get Your Slot Under 60 Seconds

DEMO.mp4

STATISTICS & FOOTPRINTS - See the Analytics from metadata of Slot Finder

Total Bookings Analysis till Date

StatisticsTillToday

Total Bookings Analysis for Today

StatisticsTillToday

Download Statistics of Last 3 Versions

StatisticsDownloads

Summary of Total Bookings Analysis till Date

StatisticsTillToday

Summary Total Bookings Analysis for Today

StatisticsTillToday

Overall Bookings from Different Places till Date

StatisticsTillToday

Bookings Today vs Overall vs Yesterday

StatisticsTillToday

Total Bookings Based on Age and Platform

StatisticsTillToday

Total Bookings Trendline and App Version

StatisticsTillToday

DISCLAIMER

DUE TO LATEST CHANGES IN THE API ACCESS POLICY BY MoHFW, THERE WILL BE NO MORE COMMITS/CONTRIBUTIONS/RELEASES/MAINTENANCE IN THE PROJECT. THE PROJECT HAS BEEN PUT ON INDEFINITE HOLD. GRATEFUL TO EVERY CONTRIBUTORS, SUPPORTERS, USERS THAT WE COULD HELP YOU IN THE CRISIS. EVEN THOUGH YOU MAY STILL USE THE APP AFTER GOING THROUGH THE T&C, WE ADVISE NOT TO MISUSE IT, OTHERWISE YOU MIGHT FACE LEGAL ISSUES. USE IT AT YOUR OWN RISK

NOTE: Please go through the Disclaimer, End User Lisence Agreement & the Privacy Policy, proceed further only if you accept the Terms and Conditions to use the Application/Software

Important:

  • This is a proof of concept project. I do NOT endorse or encourage or condone, in any shape or form, automating any monitoring/booking tasks. Developed for Educational Purpose; USE IT AT YOUR OWN RISK. DEVELOPERS SHOULD NOT BE HELD RESPONSIBLE FOR ANY LEGAL CONCERNS.
  • FURTHER, ANY USE OF THE SCRIPT FOR MONETARY, UNETHICAL, OR ILLEGAL PURPOSES IS NOT PERMITTED. - IN CASE, YOU ARE FOUND TO DO THE SAME, YOU SHALL BE SOLELY LIABLE FOR THE CONSEQUENCES. THE DEVELOPER SHALL AND CANNOT BE HELD LIABLE FOR THE UNETHICAL OR ILLEGAL USE OF THE SAME
  • This goes without saying but, once you get your shot, please do help out any underprivileged people around you who may not have a laptop or the know-how. For instance any sort of domestic help, or the staff in your local grocery store, or literally the thousands of people who don't have the knowledge or luxury we do.
  • Do NOT use unless all the beneficiaries selected are supposed to get the same vaccine and dose.
  • When multiple beneficiaries are added for a single registered mobile number, all beneficiaries will get the Same Dose, Same Vaccine, Same Centre and Same Slot. In case any of this doesn't meet the requirements, booking might not be successful.
  • 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.
  • While selecting beneficiaries, also make sure that beneficiaries selected for second dose are all taking the same vaccine: COVISHIELD OR COVAXIN OR SPUTNIK V. Please do no try to club together booking for beneficiary taking COVISHIELD with beneficiary taking COVAXIN.
  • If you're selecting multiple beneficiaries, make sure all are of the same age group (45+ or 18+) as defined by the govt. Please do not try to club together booking for younger and older beneficiaries.
  • AUTO BOOKING is ON by default, so it books the slot by searching by PIN Code/District for the particular Vaccination Centre(s) or even by the Names of the Vaccination Centres within the PINCode.
  • If you accidentally book a slot, don't worry. You can always login to the Official portal and cancel or re-schedule the booking. There is no option for reschedule or cancel of Booking of Slot available in the Application. There will be an X symbol on the right-top corner for each beneficiary to cancel from CoWIN Portal.
  • There is no option to register new mobile or add beneficiaries. This can be used only after beneficiary has been added through the Official WebApp of CoWIN.
  • Application has been developed solely for the purpose of helping needy people book their vaccination slots by way of automation.
  • The Application, a public use free software, assists you in a comprehensive screening of available slots and booking the same for you. IT DOES NOT GUARANTEE A SLOT. Only if a slot is available as per your preference, will the slot be booked.
  • The Developer reserves their rights to take any legal action as enumerated under the law against any unethical or illegal use of the same.

Glimpse of the Application:

Application With Bare Miminum Configuration Changes

Application_Default

Application Start - Software Update Notifier

Application_Default

Application Start - Disclaimer, End-User Lisence Agreement, T&C, Privacy Policy Agreement Consent

Application_Default

Application Start - OTP Generation

Application Start

Application Start - OTP Validated - BearerToken Generation

Application Start

Application Start - OTP Validated - Invalid BearerToken provided in Config; Regeneration Session by Resending OTP

Application Start

Application Start - Invalid OTP Entered. Re-Generating new OTP

Application Start

Application OTP Retrigger In Case OTP is not received within time. Press Enter to Retrigger OTP

Application Start

Successful Booking Scenario - With AI-Auto Captcha

Application Sample

Successful Booking Scenario - Showing Support & Sharing Word of Mouth

Application SuccessfulBooking

Unsuccessful Booking - All Slots Full

Application Sample

Unsuccessful Booking - Server Under Heavy Load

Application Sample

Application Session Regeneration on TimeOut

Application Sample

Application OTP Validity Expired (Expiry Time 3 Minutes from Generation) when user enter the OTP for validation

Application Sample

Application Features

Following are some of the main features of the App:

  • OTP Generation/Validation
  • Search by Either PINCode or District or Both PINCode and District with preference to PINCode for better Searching
  • Search for Slots only for Particular Centres by CentreName within PINCode/District
  • Auto Retry To Fetch Slots by Dynamically computing IP Throttling Limit
  • BEEP BEEP User Notifier On IP Throlling To Notify User regarding Too Many Requests
  • OTP Notifier for New Session & On Timeout
  • Booking for Multiple Beneficiaries linked to a Registered Mobile Number
  • OTP Regeneration/Validation on Timeout/Session Expiry
  • Zero Setup Application, Just Download and Run! Easy to Use!
  • No specialized Software required for modification of Config file
  • Allow Any Vaccine Type and Any Fee Type for Booking Slots
  • Application Latest Version Check Automatically before proceeding
  • Verbose Mode so that user can check each and every step as what is going on behind the scenes when slots are being fetched & processed
  • Telemetry Metadata of Booking for Updating Statistics to see how the App is helping others. No Personal Information to be taken.
  • Integration of Notification Engine with Telegram Bot
  • Native Cross-Platform Support for Windows/Mac/Linux
  • Automatically handling IP Throttling Issue with fixed Refresh Threshold.
  • Automatically Download Appointment Slip on Successful Booking of Slot
  • Feature to Choose Slot Preference for Auto-Booking

Technical Details

It's a simple hybrid Console Application being developed using .NET Core 3.1, WinForms and C#.

Currently, application is bundled as a Single Standalone Executable file with Runtime included and therefore no installations are needed to run the Application. Application can be used in Windows/Linux/Mac without any external dependencies

In General, to run the application, the following things are needed:

  • WINDOWS: Windows 7 SP2 or higher where .NET Core 3.1 Runtime is supported, that's it.
  • LINUX: 64-bit Debian like Distros eg. Ubuntu, Mint, Kali Linux etc are supported with support for .NET Core 3.1 Runtime
  • MACOSX: 64-bit Mac OSX (Version 10.13 and above) is supported with .NET Core 3.1 Runtime

.NET Core 3.1 Runtime is bundled in the Release so no other external dependencies to run the Application. FOR DEVELOPERS TO BUILD/MODIFY .NET Core 3.1 SDK is required to build from Source Code or to make some customizations. Use of Visual Studio 2019 is recommended for the purpose of development.

Currently, searching using the findByDistrict API and findByPin API are integrated to get all the available slots in a particular district/PINCode.

There is API throttling (Rate-Limiting) of 100 requests/5 minutes from 1 IP Address. Application heuristically switches automatically to circumvent the issue for finding slot.

How to Use:

For Folks who just want to get shit done

For Windows Users:

  • Get the Latest Release of the Software either by clicking here or from Releases Section of Github
  • Download the ZIP file of the Latest release for your Operating System [OS Name is suffix in the Release Version Name eg. CoWinReleasesv5.2.2-windows.zip]
  • Extract the ZIP file, you'll find two file like this:

Application Release

  • Modify the settings inside appsettings.json
  • Double Click CoWinVaccineSlotFinder.exe to RUN the Application.

How to run on macOS/Linux Systems :

  • Get the Latest Mac Release either by clicking here or from Releases Section of Github

  • Get the Latest Linux Release either by clicking here or from Releases Section of Github

  • Download the ZIP file of the Latest Release for your Operating System [OS Name is suffix in the Release Version Name eg. CoWinReleasesv5.2.0-osx.zip or CoWinReleasesv5.2.0-linux.zip]

  • Extract the ZIP file

  • Modify the settings inside appsettings.json as mentioned below.

  • Go the the downloaded folder for eg : Users/xyz/Downloads/CoWinReleases/

  • To run the executable file open terminal of your choice in the Downloaded Folder Path

  • Run the command bash run.sh in the Terminal to Start the App

Troubleshooting macOS Problems :

  • While downloading, after download is complete in the browser, it might show you that the downloaded file might contain viruses. There'll be an option to Discard or to Keep. You must keep it.

  • If an error pops up like : Application can't be opened because it is from an unidentified developer.

  • Go to System Preferences -> Secuity & Privacy -> Allow apps downloaded from: Select App Store and identified developers

  • Even after Allowing the App downloaded from Identified Developer, you might need to explicity allow CoWinVaccineSlotFinder from the above option

  • In case it asks your permission to Open/Move To Bin for the Application as it is not downloaded from AppStore, use Open otherwise it won't run

How to Open appsettings.json

In layman terms, it is just like any other text file which can be opened in any text editor like Notepad, Wordpad, VS Code, Sublime Text, Notepad++ etc. Modification can be done and file to be saved again with the same name and File Types as "All Files"

How to Get User Specific Information for appsettings.json

  1. Go to cowin.gov.in
  2. Generate OTP for your registered mobile number. You need to provide this mobile number in the appsettings.json file.
  3. Validate the OTP
  4. After you are logged in, you'll see a dashboard like this, get the highlighted number REF ID, which is your beneficary ID and would be required in your appsettings.json. If you have multiple members added in your registered mobile number, you will get multiple REF IDs. Use the REF IDs for which you want to do booking

BeneficiaryID

  1. Also, Once all these details are fetched, put them in the appsettings.json.
  2. Run the Application CoWinVaccineSlotFinder.EXE, that's it.

You may also see a file with the name authToken.json in your directory when you are running the Application. This is done so that your session information is stored locally in your device and you don't need to enter OTP manually until 15 minutes, in case you close the Application and run again, it will resume with your previous session. That is possible because of your data stored in this authToken.json file. However, that being said this doesn't mean that you don't have to enter OTP. You still have the dependency of entering OTP in the Application, just that if you have to close the Application due to IP Throttling or some other issue, you can resume if your Token is still valid without waiting for a new OTP.

Configuration Changes

The values of the following items MUST BE MODIFIED in appsettings.json

"BeneficiaryIds": [ "REPLACE_WITH_YOUR_BENEFICIARY_ID_1", "REPLACE_WITH_YOUR_BENEFICIARY_ID_2" ] 
// You'll get the beneficiary ID from Step 4 above. 
// If you have only 1 beneficiary ID then Use it in the <REPLACE_WITH_YOUR_BENEFICIARY_ID_1> section and remove rest like "REPLACE_WITH_YOUR_BENEFICIARY_ID_2" eg. ["1111111111111111"]. 
// If you have multiple beneficiaries for which you want to do booking, added them comma separated eg. ["11111111111111", "22222222222222", "33333333333333"]
"Mobile": "REPLACE_WITH_YOUR_REGISTERED_MOBILE_NO", 
// Use your registered mobile number used for generation of OTP in Step 2 above.
// Use it in the REPLACE_WITH_YOUR_REGISTERED_MOBILE_NO section. Suppose your Mobile Number is 8888333388 then it'll be like "Mobile" : "8888333388". 
// *NOTE* Don't use +91 infront of your mobile number, use only 10 digit mobile number
"DoseType":  "<REPLACE_ME>", // Use either 1 OR 2 Depending on 1st DOSE or 2nd DOSE in the <REPLACE_ME> section, by default 1 is selected for 1st Dose
"PINCodes": [
  "REPLACE_ME_WITH_YOUR_PIN_CODE_1",
  "REPLACE_ME_WITH_YOUR_PIN_CODE_2"
]
// You can use multiple PINCodes for which you wish to search for, examples are of Mumbai and nearby areas. 
// If you want to search say for a particular PIN Code of Mumbai let's say 400008 then the entry would look like this : "PINCodes": [ "400008" ].
// Basically, Replace REPLACE_ME_WITH_YOUR_PIN_CODE_1 WITH 400008. and remove everything else.
// In case you want to search for multiple PIN Codes say 400008 and 400007, 
// you'll have to remove REPLACE_ME_WITH_YOUR_PIN_CODE_1 with 400008 and REPLACE_ME_WITH_YOUR_PIN_CODE_2 with 40007 and so in, it would look something like this "PINCodes": [ "400008", "400007" ]

The values of the following items MAY BE MODIFIED in appsettings.json, default values are set

Please Note: DO NOT Change or remove to Defaut values if you are not going to use the setting for your Searching of Slot.

"MinAgeLimit": "<REPLACE_ME>", // Use either 18 or 45 in the REPLACE_ME Section. 18 means that you are searching for slots of 18+ and 45 means for 45+. By default, 18 is used.
"MaxAgeLimit": "<REPLACE_ME>", // Use either 44 or 99 in the REPLACE_ME Section. 44 means that you are searching for slots of only 18+ (18-44) Age Group and 100 means that you are searching for only 45+ (45-99) age group. By default, 44 is used.
"MinimumVaccineAvailability": "<REPLACE_ME>", // Use 1 or any Minumum Number that you feel should be available atleast when you are searching for slots, in the REPLACE_ME section. By default, 1 is selected as minimum availability
"ProtectedAPI": { "IsToBeUsed": "<REPLACE_ME>"} // Use true of false in the <REPLACE_ME> section. Use false if you want to search slots using Public API. By default, true to use ProtectedAPI for searching
"VaccineType": "<REPLACE_ME>", // USE EITHER COVAXIN OR COVISHIELD, OR SPUTNIK V or "" in the <REPLACE_ME> section, by default "" is selected with means any type of Vaccine
"VaccineFeeType": "<REPLACE_ME>", // USE Either Free or Paid or "" in the <REPLACE_ME> section, by default "Free" is selected, blank implies both Free and Paid types
"SlotPreference": "<REPLACE_ME>", // Preference of Slot of Booking, use either First or Last or Random in the <REPLACE_ME> section; Default is Last (due to higher changes of getting the slot)  
"IsSearchToBeDoneForVaccinationCentreName": "<REPLACE_ME>", // se Either true or false in the <REPLACE_ME> section where true means you want to search for specific Centres within your PINCode/District and false means you don't want to search by CentreName. By default, false is selected
"VaccinationCentreNames": [
    "REPLACE_ME_WITH_YOUR_VACCINATION_CENTER_NAME_1",
    "REPLACE_ME_WITH_YOUR_VACCINATION_CENTER_NAME_2"
], // You need to put the exact names of the Vaccination Centres for which you want to search in the REPLACE_ME_WITH_YOUR_VACCINATION_CENTER_NAME_1, REPLACE_ME_WITH_YOUR_VACCINATION_CENTER_NAME_2 sections.
// You'll get the names of the Centres from CoWIN Portal. By default all Vaccination Centres in the District/PINCodes are selected. Filter will work only if you set the IsSearchToBeDoneForVaccinationCentreName to true and provide proper exact names of the Centres for which you are searching slots
"IsSearchToBeDoneByPINCode": "<REPLACE_ME>", // Use Either true or false in the <REPLACE_ME> section where True means searching is done using PIN Code, by default true is selected. Set this is True if you want to search By PIN Code
"DateToSearch": "<REPLACE_ME>",  // Use date in DD-MM-YYYY Format in the <REPLACE_ME> section, Blank implies date of next day (i.e, tomorrow), by default "" is selected to search for Next Day
"IsSearchToBeDoneByDistrict": "<REPLACE_ME>", // Use Either true or false in the <REPLACE_ME> section where True means searching is done by DistrictId, by default false is selected, Set this is True if you want to search By District
"Districts": [
  "REPLACE_ME_WITH_YOUR_DISTRICT_CODE_1",
  "REPLACE_ME_WITH_YOUR_DISTRICT_CODE_2"
],
// You'll get District Codes from the link below this block, examples are for Mumbai and nearby districts. 
// Basically, Replace REPLACE_ME_WITH_YOUR_DISTRICT_CODE_1 with 395, then the entry would look like this : "Districts": [ "395" ].
// In case you want to search for multiple Districts say Mumbai and Thane, get the District-District Code Mapping from below "State-District-DistrictCode Mapping", // you'll get the DistrictCode of Mumbai as 395 and of Thane as 392.
// You'll have to remove REPLACE_ME_WITH_YOUR_DISTRICT_CODE_1 with 395 and REPLACE_ME_WITH_YOUR_DISTRICT_CODE_2 with 392, it would look something like this "Districts": [ "395", "392"]
"SleepIntervalInMilliseconds": "<REPLACE_ME>", // In the <REPLACE_ME> Section, Use the Time Interval in Milliseconds you want the system to take rest after trying out your Search Criteria of PIN/District/CentreName once. This will help in lessening the chances of getting IP Throttled. Default is 3500
"IsThrottlingToBeUsed": "<REPLACE_ME>", // In the <REPLACE_ME> Section, Use either true or false; By default true; True means IP throttling is there, False means IP throttling has been removed
"ThrottlingThreshold": "<REPLACE_ME>", //In the <REPLACE_ME> Section, Use the Number of requests per IP allowed for ThrottlingInterval. By default it is set to 100
// Say Throttling Interval is 5 minutes and ThrottlingThreshold is 100, that means, you are allowed for 20 Hits from your IP Address per minute. 
// Change these values accordingly whenever you face the issue of IP being throlled by Server. 
// You may even switch to a different network/IP/Proxy Server so that this can remove the IP Throttling issue for you
"ThrottlingIntervalInMinutes": "<REPLACE_ME>", // In the <REPLACE_ME> Section, use the Interval of Time that is being set for throttling of IP Address. By Default it is // set to 5 which means 5 minutes i.e, in Interval of 5 minutes, 100 requests from your IP Address/Software is allowed. After that you'll receive error unless you switch to another network.
"ThrottlingRefreshTimeInSeconds": "<REPLACE_ME>", // In the <REPLACE_ME> Section, use the Interval of Waiting Time in Seconds when IP is throttled, before resuming the application again. 
// By default, 5 seconds is set as the Refresh Time
// Set the value Higher if you want more wait time when you IP is throttled, or Lower if you are in hurry to book (with chances of getting IP throttled more frequently) 
"Proxy": 
{
   "IsToBeUsed": "<REPLACE_ME>", // Use true or false, true if you are behind Proxy Server, false if you're not, in the <REPLACE_ME> section, by default false would be selected
   "Address": "<REPLACE_ME>" // Use the THE PROXY ADDRESS IF YOU ARE BEHIND PROXY SERVER (usually in Office/Corporate Network) in the <REPLACE_ME> Section, by default this will be blank
}

You can get the District Name and District Code Mapping from State-District-DistrictCode Mapping. Just copy the values of the DistrictCode from the file and paste it in the appsettings.json file's {"Districts"} Or, you can refer the readable State-District-DistrictCode Markdown file and get the values of District Codes from there.

Entries in the State-District-DistrictCode Mapping file would be like below. In this case, the DistrictCode will 3, 1 and 2.

  "Andaman and Nicobar Islands": {
    "Nicobar": 3,
    "North and Middle Andaman": 1,
    "South Andaman": 2
  }

Be default, this is how the appsettings.json would look like this:

{
  "CoWinAPI": {
    "PublicAPI": {
      "FetchByDistrictUrl": "https://cdn-api.co-vin.in/api/v2/appointment/sessions/public/findByDistrict",
      "FetchByPINUrl": "https://cdn-api.co-vin.in/api/v2/appointment/sessions/public/findByPin"
    },
    "ProtectedAPI": {
      "IsToBeUsed": true, // Set this to false if you want to search slots using Public API
      "FetchByDistrictUrl": "https://cdn-api.co-vin.in/api/v2/appointment/sessions/findByDistrict",
      "FetchByPINUrl": "https://cdn-api.co-vin.in/api/v2/appointment/sessions/findByPin",
      "ScheduleAppointmentUrl": "https://cdn-api.co-vin.in/api/v2/appointment/schedule",
      "AppointmentSlipUrl": "https://cdn-api.co-vin.in/api/v2/appointment/appointmentslip/download",
      "BeneficiaryIds": [ "REPLACE_WITH_YOUR_BENEFICIARY_ID_1", "REPLACE_WITH_YOUR_BENEFICIARY_ID_2" ]
    },
    "Auth": {
      "IsToBeUsed": true,
      "OTPGeneratorUrl": "https://cdn-api.co-vin.in/api/v2/auth/generateMobileOTP",
      "OTPValidatorUrl": "https://cdn-api.co-vin.in/api/v2/auth/validateMobileOtp",
      "Secret": "U2FsdGVkX18vDwDor+oOIG7vSUnINtlc/pxQcNiBulCm8LT5Sza+aIISKLqImbpMnRYgsN2QACPhggLWgZEpQg==",
      "Mobile": "REPLACE_WITH_YOUR_REGISTERED_MOBILE_NO"
    },
    "SleepIntervalInMilliseconds": 3500,
    "IsThrottlingToBeUsed": true, // Use either true or false; By default true; True means IP throttling is inplace, False means IP throttling has been removed
    "ThrottlingThreshold": 100, //Number of request per IP allowed for ThrottlingInterval
    "ThrottlingIntervalInMinutes": 5,
    "ThrottlingRefreshTimeInSeconds": 5, // Waiting Time when IP is throttled, before resuming the application again. Set the value Higher if you want more wait time when you IP is throttled, or Lower if you are in hurry to book (with chances of getting IP throttled more frequently)
    "TotalIterations": 10000,
    "SelfRegistrationPortal": "https://selfregistration.cowin.gov.in",
    "MinAgeLimit": 18,
    "MaxAgeLimit": 44,
    "MinimumVaccineAvailability": 1,
    "VaccineType": "", // Blank Implies Any VaccineType: COVISHIELD OR COVAXIN OR SPUTNIK V; Default is any type of Vaccine
    "DoseType": 1,
    "VaccineFeeType": "Free", // Blank Implies Any VaccineFeeType: Free or Paid; Default is Free    
    "SlotPreference": "Last", // Preference of Slot of Booking, use either First or Last or Random; Default is Last (due to higher changes of getting the slot)  
    "IsSearchToBeDoneForVaccinationCentreName": false, // Set this is true if you want to search for specific Centres within your PINCode/District
    "VaccinationCentreNames": [ // Don't change me if you are not setting IsSearchToBeDoneForVaccinationCentreName as true
      "REPLACE_ME_WITH_YOUR_VACCINATION_CENTER_NAME_1",
      "REPLACE_ME_WITH_YOUR_VACCINATION_CENTER_NAME_2"
    ], // You need to put the exact names of the Vaccination Centres for which you want to search. You'll get that from CoWIN Portal
    "IsSearchToBeDoneByPINCode": true, // Set this as true if you want to set by PINCode
    "PINCodes": [
      "REPLACE_ME_WITH_YOUR_PIN_CODE_1",
      "REPLACE_ME_WITH_YOUR_PIN_CODE_2"
    ],
    "IsSearchToBeDoneByDistrict": false, // Set this is true if you want to search By District
    "Districts": [ // Don't change me if you are not setting IsSearchToBeDoneByDistrict as true
      "REPLACE_ME_WITH_YOUR_DISTRICT_CODE_1",
      "REPLACE_ME_WITH_YOUR_DISTRICT_CODE_2"
    ],
    "DateToSearch": "" // DD-MM-YYYY Format, Blank implies tomorrow's day; Slots are searched ONLY FOR THE DATE in DateToSearch
  },
  "Proxy": {
    "IsToBeUsed": "false",
    "Address": ""
  }
}

As simple as that!

Enjoy and feel free to Star the Repo, if it could help you in any way!

For Developers or Curious Minds:

If you have Visual Studio installed, go ahead an Clone the Repository, Open the SLN file, Make changes in appsettings.json, Ctrl + F5 and Boom! It will do the searching for you, your booking will get done but your booking notifications won't work and you'll get System.IO.InvalidDataException exception. Reason for this is that Telemetry and Notification Module needs an Base64 encoded Encrypted Endpoint, API Key and Secret. Since it's not a good practice to HardCode it in Source Code, so it won't work unless you get the Encrypted API Endpoint, Telegram Bot Auth Token and the Secret Key along with similar API Endpoint and Secret Key for Telemetry. Unless you care about these, you can proceed, everything will work just fine!

Still curious about that, check out Telemetry and TelegramBotModel

However the standalone release for Windows/Linux/MacOS has all these dependencies buldled so you don't need to worry about anything! Everything will work seamlessly, we got your back!

Well, want to dig deeper?

So basically, you've this Project Named CoWin.Core which contains appsettings.json which performs most of the magic. CoWin.UI is just a small project for handling the Captcha. CoWin.Tests is used for Automated Unit Tests.

Rest of the Business Logic are there inside the /Models directory. Authentication & Authorization stuffs can be found in /Auth directory. API consumption stuffs can be found in /Providers directory. Application begins from Program.cs from the CoWin.Core project.

Clean Coding Practices have been followed during the development of the Application within a span of 2 days after Office Hours. So, you won't find proper Exception Handling, using Dependency Injection or Logging or even Documentation, duh!

I know, I know, it's unacceptable, but folks, it's all about quick Time to Market first and then doing one thing at a time, to improve the product.

I'll be more than happy to have PRs with modifications.

If you'd like to do it the hard way, clone it, build it and run it. Make sure you've the dependencies required to run the Application as mentioned in Technical Details Section

FAQs

  • What should be the Configuration Changes if I want to book for 15-18 age group (which includes only 15 to 18 Age)

Configuration Should Be "MinAgeLimit": 15, "MaxAgeLimit": 18 in appSettings.json

  • What should be the Configuration Changes if I want to book for 15 & Above Category (which includes 15+, 18+ & 45+ as well)

Configuration Should Be "MinAgeLimit": 15, "MaxAgeLimit": 100 in appSettings.json

  • What should be the Configuration Changes if I want to book for 18 & Above Category (which includes 45+ as well)

Configuration Should Be "MinAgeLimit": 18, "MaxAgeLimit": 100 in appSettings.json

  • What should be the Configuration Changes if I want to book for 18-44 age group (which includes only 18 to 44 Age)

Configuration Should Be "MinAgeLimit": 18, "MaxAgeLimit": 44 in appSettings.json

  • What should be the Configuration Changes if I want to book for 45 & Above age group (which includes only specificially for 45+)

Configuration Should Be "MinAgeLimit": 45, "MaxAgeLimit": 100 in appSettings.json

  • What should be the Configuration Changes if I want to First Dose ?

Configuration Should Be "DoseType": 1

  • What should be the Configuration Changes if I want to Second Dose ?

Configuration Should Be "DoseType": 2

  • What should be the Configuration Changes if I want to Book Specific Vaccine Type ?

Configuration Should Be "VaccineType": "COVISHEILD" if you want to get Covishield, "VaccineType": "COVAXIN" if you want to get Covaxin, "VaccineType": "SPUTNIK V" if you want to get SPUTNIK V

  • What should be the Configuration Changes if I want to Book Slot for Today ?

By Default, the Application books slot for the Next Day on which searching is done. To book for taday, you need to use the date of today in "DateToSearch". Let's say today is 8th July 2021 and you want to book slot for today. Configuration Should Be "DateToSearch": "08-07-2021". By default, "DateToSearch" : "09-07-2021" will be used for searching slot, i.e, for next day

Cheers!

NB: appsettings.json play the major role for accessing and booking and filtration of searches. Fiddle with it! Appologies that the Code doesn't have inline documentation, but code is readable and self explanatory. In case of any suggestions or bugs or feature request, feel free to raise an Issue.

Contact us for any further queries or bug report by mailing us at Vaccine Slot Finder

cowinvaccineslotfinder's People

Contributors

akulr avatar ipshita2207 avatar isatishyadav avatar priyanka1111 avatar psuyog97 avatar srvsaha avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

cowinvaccineslotfinder's Issues

Default Date To Search for Slot Booking to be done for Next Day for better UX

Currently, DateToSearch the slot for Vaccination is set as CurrentDate. So currently, is date is not changed, slots for the current date are searched. And in case user changes the date, the date entered by User is used for searching.

Date is a very peculiar thing and the format of the date used is as per the current date format of the System example: 12-May-2021 as the format of my system's date is DD-MM-YYYY. This might not be the case for every user's system.

image
image

Since generally slots are opened for the next day for booking:

eg. Slots open at 8 PM in Mumbai on say 10-05-2021 to Book for 11-05-2021.

As such, it is better to keep the DateToSearch as the date of the next day and in case, user wants to book for the current day, then changes has to be done in appsettings.json for the field DateToSearch.

"DateToSearch": "" // System's Date Format, Blank implies next date

@priyanka1111 Please review and make changes in the README and config

Proper message doesn't show up when Vacccination Centre is Not Available

Describe the bug
There are scenarios where Vaccination Centres are Blank.
In that Case, users are not shown any message.

To Reproduce
Steps to reproduce the behavior:

  1. Open the App
  2. Select Any PIN Code from which there are no CVCs.
  3. You'll see no messages being shown to user as no available slots.

Expected behavior
Should tell the user that no centres available.

Screenshots
image

Desktop (please complete the following information):

  • OS: Windows
  • Version 10

Additional context
NA

[Question]Does auto-captcha work?

I've integrated something very similar in a python script but I'm not sure how to write tests to verify if it works. The captcha integrated here works similarly. I was wondering if you've tested that either via a UT or on cowin.

Add support for SPUTNIK V Vaccine Type

Is your feature request related to a problem? Please describe.
Since in CoWIN App, SPUTNIK V Vaccine Type is introduced, add the support for it in the Application so that user can book that as well.

Describe the solution you'd like
By Default, any of these vaccines COVISHIELD, COVAXIN, SPUTNIK V are to be selected. And then based on the User Input, VaccineType has to be filtered.

API Structure of Get By PIN or District has changed; Segregation is done between Dose Type 1 & Dose Type 2

Describe the bug
The APIs which provide the slots information of Covid Vaccination Centres by PIN or by District has changed the structure to send provide the Availability of Vaccines segregated between Dose Type 1 and Dose Type 2.
Therefore, changes are to be done to fix this as per the Dose Type in the Config File

"DoseType": 1/2,

New API Structure:

{
  "centers":[
    {
      "center_id":1234,
      "name":"District General Hostpital",
      "name_l":"",
      "address":"45 M G Road",
      "address_l":"",
      "state_name":"Maharashtra",
      "state_name_l":"",
      "district_name":"Satara",
      "district_name_l":"",
      "block_name":"Jaoli",
      "block_name_l":"",
      "pincode":"413608",
      "lat":28.7,
      "long":77.1,
      "from":"09:00:00",
      "to":"18:00:00",
      "fee_type":"Free",
      "vaccine_fees":[
        {
          "vaccine":"COVISHIELD",
          "fee":"250"
        }
      ],
      "sessions":[
        {
          "session_id":"3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "date":"31-05-2021",
          "available_capacity":50,
          "available_capacity_dose1":25,
          "available_capacity_dose2":25,
          "min_age_limit":18,
          "vaccine":"COVISHIELD",
          "slots":[
            "FORENOON",
            "AFTERNOON"
          ]
        }
      ]
    }
  ]
}

Allow Filter to be Done on Vaccination Center Names; Support Filter By Multiple Vaccination Centres

Usually, in case of cities, searching by PIN or District works fine because of less Geographical Area. However, in case small towns or village, it is pretty difficult just to get slot based on PIN or District as there are scenarios where CVCs (Covid Vaccination Centres) are around 30km apart still share the same PIN Code. In that case, it makes sense to give the User ability to Filter on CVC's Name.

Name of the CVC can be found from COWIN's Portal:
image

For Example, in the above scenario, the name of the CVC is > Apollo Hospital Modern School

OTP Error

While running the executable file, I'm getting an OTP error message and the script exits on it's own

Application Should Check for Availability of Latest Version before proceeding so that UX is better and User knows about Latest Version

Require Application Version Checker

Describe the solution you'd like
On Load of the Application, the Latest Release in Github for the Repo should get checked with the current version in user's machine and then prompt the user for forceful update if there is a breaking change: That is change in the Major Version of SEMANTIC Versioning format. Else, just inform user that update can be done.

Configuration File Should be Validated before Proceeding with Slot Booking

Is your feature request related to a problem? Please describe.
Since the Configuration file appsettings.config takes in user input, so there is a chance that user has either not modified the configuration file itself or has provided with some incorrect value which was not expected. So, application should handle those scenarios before proceeding.

Example: Suppose user wants to search by District and has entered the values inside "Districts": {FOO, BAR}, but has forgotten to set to value of IsSearchToBeDoneByDistrict as true. In that case, the searching would not happen, while the user would be expecting that the App is searching.

Describe the solution you'd like
Basically there should be some sort of semantic parser which parses the config and checks if the default values are overwritten in the config.
If not, then it should let the user know which all configs are not overwritten and must be modified.
Also, if defaults are overwritten and user is not providing the proper values after overwriting, App should inform the user about the issue so that it can be changed and the Application can be run again.

This is to be done fore Auth Module and FinderModules are called.

Describe alternatives you've considered
N/A

Additional context
Issue #19 #22 #24

Feature Request

Hey @SRvSaha , Would it be possible to pause the request in the middle off session using any keyboard shortcut or something so that when ever we want, we resume the checking again.

Just thought of it.. What do you think..

Allow Any Vaccine Type and Any Fee Type for Booking Slots for Appointment

As of now, we don't have the option to allow for any Vaccine Type. Either COVISHIELD or COVAXIN is to be provided by User along with the VaccineFeeType as Free or Paid.

However, due to surge in demand of Vaccine, users might not be bothered about the Vaccine Type or the Fee as the main thing for them would be to get the vaccine first.

Therefore, filter on VaccineType and VaccineFeeTypeshould not be made mandatory. It should be optional and it should be upto the user whether the user wants any specific type of vaccine and with specific fee type.

So, in case user provides blank for the field VaccineType and VaccineFeeType in appsettings.json, then VaccineType would be made optional. Similarly is VaccineFeeType is kept blank, feeType of vaccine would be treated as optional for searching of slots.

Example:

Optional Scenario

    "VaccineType" :  "",
    "VaccineFeeType" :  ""

Specific Filter on Vaccine Type / VaccineFeeType

    "VaccineType" :  "COVISHIELD",
    "VaccineFeeType" :  "Free"

Captcha Popup not in Focus by Default. Manual Intervention required

The following UX Issue is observed with Captcha:

  • While Captcha is popped up, focus is not on the Popup Form, User has to click the Captcha form and then type the captcha value and then press Enter. That kills some time, so need to make the Form Active and on Focus with Focus on Text Box where Captcha is to be entered so that user can right away type the Captcha and submit without any time waste.

Search by Both PIN Code and District to be Allowed with Preference on PIN Code

Currently, feature is available to either book using PIN Code or using District with by default PIN Code being selected.
However it would be nice if feature can be added so that user can search by both with preference to PIN Code first and then district so that in case user doesn't get slot for a particular PIN Code, they might be able to get slot on the district level.

Captcha Model Encrypted Trained Model and Secret Key

Hello @SRvSaha ,
After taking latest while book slot error comes:
public const string ENCRYPTED_TRAINED_MODEL = "YOUR_TRAINED_MODEL_HERE";
public const string SECRET_KEY = "YOUR_MODEL_DECRYPTION_KEY";
Can you please help me with what value need to pass here?

image

Thanks.

Program Stuck in Fetching Resources

Hi, The Program is stuck in fetching resources once I have submitted the top. I have modified the json file as per your instructions and also modified the file to use district instead of Pincode.

Let me know how to solve this. Thanks in advance.

Unable to book

Faced 2 issues today.

  1. Slot showing late on the 4.0 version
  2. Getting unathenticated access error

unathenciated

Change is session schema

There is a change in the schema for sessions available. Now there is 2 different availability for dose 1 and dose 2. So, it is required to check the availability of the dose required by the user. currently, it is asking for a captcha even if there is no availability of dose 1 and then throws an error the booking is full.

"sessions": [
{
"session_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"date": "31-05-2021",
"available_capacity": 50,
"available_capacity_dose1": 25,
"available_capacity_dose2": 25,
"min_age_limit": 18,
"vaccine": "COVISHIELD",
"slots": [
"FORENOON",
"AFTERNOON"
]

Development of Notification Feature for Application Admin for Telemetry without taking any Confidential User Specific Data.

Is your feature request related to a problem? Please describe.
Whenever booking happens, due to client system being a standalone system, there is no information to Developers regarding the Bookings made using the App and how many people faced error.

Describe the solution you'd like
A telemetry solution to be developed which will not include any user's private data. Only the metadata of the Booking to be taken so that it can help understand and reach better.

Describe alternatives you've considered
Telegram is an option, Microsoft Telemetry of Azure. So, in the initial phase we'll start with Telegram and then see how things fare!

Additional context
NA

Not finding the slots correctly

Hi,
I think the application is not finding the slots correctly. Getting notification from other sites that the slots were available but the application is not finding them even though it is running. It just keeps on fetching data. Tried with Both District search and Pincode search. But same issue

Queries

  1. What values should I enter in min max age for 60+ age group
  2. When I am starting the application, it is stopping after reaching approx 500 iterations; although the iteration count is set to 10000

PIN and District should be array instead of Key-Value pairs

Is your feature request related to a problem? Please describe.
PIN and District are currently Key-Value pairs. The keys in-turn unnecessarily need to be entered by user.

Describe the solution you'd like
PIN and District should be array of strings instead of Key-Value pairs.

Describe alternatives you've considered
NA

Additional context
NA

Auto Catpcha working?

auto captcha didn't work for me on 4.1.0

received popup for captcha had to manually put but it was already booked

Bearer Token Should be able to get passed for Session Continuity

Is your feature request related to a problem? Please describe.
Bearer Tokens are used as Auth Tokens using OpenID Connect. So, usually what happens is, if a user has started the App and feel that something is wrong in the config file, he has to close the App. After fixing the config, if he tries again, he needs to provide the captcha once again.

This is a bit difficult to get OTP every time on time.

Describe the solution you'd like
Provide a way to user to enter their Auth Token and also show them their current Auth Token, so that they can leverage it

Describe alternatives you've considered
N/A

Additional context
Developers will have easy time in debugging when Bearer Tokens can be passed

Internal Server Error on Schedule Appointment

Schedule Appointment API gives Internal Server Error. Code 500

Headers are given below:

{'Content-Type': 'application/json; charset=utf-8', 'Content-Length': '2', 'Connection': 'keep-alive', 'Date': 'Fri, 14 May 2021 06:56:39 GMT', 'x-amzn-RequestId': '2e7b1e70-08c6-4049-a482-18862c5ae968', 'X-DNS-Prefetch-Control': 'off', 'X-XSS-Protection': '1; mode=block', 'Access-Control-Allow-Origin': '*', 'Strict-Transport-Security': 'max-age=15552000; includeSubDomains', 'x-amzn-Remapped-Content-Length': '2', 'X-Frame-Options': 'DENY', 'Access-Control-Allow-Headers': 'Content-Type, Authorization', 'x-amzn-Remapped-Connection': 'keep-alive', 'X-Download-Options': 'noopen', 'x-amz-apigw-id': 'fTnOQFUqhcwFjHw=', 'X-Content-Type-Options': 'nosniff', 'ETag': 'W/"2-vyGp6PvFo4RvsFtPoIWeCReyIC8"', 'Access-Control-Allow-Methods': 'GET,POST,OPTIONS', 'Access-Control-Expose-Headers': 'Version', 'X-Amzn-Trace-Id': 'Root=1-609e1f27-45a214651ac95ecf0839be52', 'x-amzn-Remapped-Date': 'Fri, 14 May 2021 06:56:39 GMT', 'Access-Control-Allow-Credentials': 'true', 'X-Cache': 'Error from cloudfront', 'Via': '1.1 dfa341e087e42ff5ffabf58ef776d65b.cloudfront.net (CloudFront)', 'X-Amz-Cf-Pop': 'BOM52-C1', 'X-Amz-Cf-Id': 'sbr2Ibq0LJ1mcQCLfa4lG2Qr_28qjLctyT1AWJghORcJgPpAl-ZfFg=='}

Sound for OTP

This could be an addon to this script but the sound should be like OTP required or something very different to the ones in Slot Availability to avoid confusion.

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.