Console application which
- checks the availability of slots using calendarByDistrict API. (API to get planned vaccination sessions for 7 days from a specific date in a given district.)
- Notifies the user by sending an email with availability details.
Task Scheduler in Windows, is used to run the above console app at specific intervals.
The console app requires a total of 4 command line arguments.
-
Sample District Codes in Kerala
- 301: Alappuzha
- 307: Ernakulam
- 306: Idukki
- 297: Kannur
- 295: Kasaragod
- 298: Kollam
- 304: Kottayam
- 305: Kozhikode
- 302: Malappuram
- 308: Palakkad
- 300: Pathanamthitta
- 296: Thiruvananthapuram
- 303: Thrissur
- 299: Wayanad
-
To find District ID for other states:
- Go to the Cowin Portal in your browser
- Open the Network tab in browser
- Search for vaccine availabilty in portal
- Check the Network tab for request details
- Find district_id property value from the details
-
This file part of the repository bhattbhavesh91/cowin-vaccination-slot-availability seems to have a full list of District IDs listed.
Obtained as part of pre-requisites. Check below.
The email address used to set up the Single Sender Identity as part of pre-requisites. Check below.
The email address to be notified. Cannot be same as the From Email.
- .NET Core 3.1 or later. Link to .NET Core 3.1 Runtime (v3.1.14) - link
- Create a SendGrid account to send emails. (Free sign-up)
- You will be asked to verify the account / setup MFA.
- Create a 'Single Sender Identity' which will be used to send emails from. (Left navigation -> Marketing -> Senders) | Tutorial
- Create an API Key with full access for simplicity. (Left navigation -> Settings -> API Keys)
- Download the contents of Executables folder.
- For non techies:
- Download the repository by clicking on the green button with 'Code' and then on 'Download ZIP'.
- Extract the zip.
- For non techies:
- Open terminal or command prompt and change your directory to the 'Executables' folder you have just extracted.
- Test the console app by using the below command.
- Make sure pre-requisites are in place.
CowinAvailabilityTracker.exe <DISTRICT ID> <SENDGRID API KEY> <FROM EMAIL> <TO EMAIL>
- Open Task Scheduler in Windows. (Search for it in the start menu)
- Click on 'Create Task' from Actions.
- In the General tab, provide a name for the task.
- In the Triggers tab,
- In the Actions tab,
- Create a new action
- In the Program/script field, browse and select the .exe file downloaded as part of step 1.
- In the Add arguments field, provide space separated command line arguments.
<DISTRICT ID> <SENDGRID API KEY> <FROM EMAIL> <TO EMAIL>
- Optional: In the Settings tab, check the option - Run task as soon as possible after a scheduled start is missed.
- If this setting is checked, the Task Scheduler service will start the task if the task was scheduled to run at a certain time, but for some reason (for example, the computer was turned off or the Task Scheduler service was busy) the task was not activated.
- Optional: In the Conditions tab, uncheck the option - Start the task only if the computer is on AC power
- Download the contents of Executables folder.
- Open Terminal and browse to the folder.
- Run the following command:
dotnet run CowinAvailabilityTracker.dll <DISTRICT ID> <SENDGRID API KEY> <FROM EMAIL> <TO EMAIL>
- Optional: You can use Automator to run a Shell script at periodic intervals as well.