This only works if the phone you get OTPs on is an Android phone.
Things you'll need to have before you get this running:
- Tampermonkey
- Google Messages as the default SMS app on your phone
- Node.js
- Google Chrome
- Set Google Messages as your default SMS app
- Log in to https://messages.google.com/web and start getting SMSes on your Google Chrome
- On your Google Messages Web, open the conversation where you get OTPs from CoWIN. If you don't have any OTPs from CoWIN yet, try logging into CoWIN. When you do open the conversation, the URL looks something like this: https://messages.google.com/web/conversations/617 with the number
617
at the end replaced by something else.
- While still on the Google Messages conversation page, open Tampermonkey extension and click on "Create a new script..."
- On the Tampermonkey page that just opened, replace the existing code with the one in
tampermonkey.js
file from this repo - On line 7 in the code set replace https://messages.google.com/web/conversations/617 URL with the URL of conversation with OTPs in your Google Messages Web. The number "617" would be changed by something else.
- Refresh Google Messages Web page
- Open
config.json
file - Set the name as the exact name you have set in CoWIN
- Set your phone number
- Set your age
- Set whether or not you want Covaxin. (true/false)
- On line 7, set the "search" URL. Watch this video to learn how to get this URL: https://youtu.be/a-nJBLbIdTw
- Navigate from terminal/command-prompt to the directory with the code
- Execute
npm i
- If you already have an appointment, execute
node reschedule
- If you don't already have an appointment, execute
node schedule
- You will keep getting OTPs every 15 minutes to log in
- Do not close the Google Messages Web tab. If you use a tab suspender on your browser, whitelist the URL.
- Keep the terminal running.
- If the script fails for some reason, you will stop getting OTPs. Re-run
node reschedule
ornode schedule
. - You'll get an SMS as soon as your appointment has been scheduled or rescheduled.
- You'll keep seeing an error every 5 seconds. You can ignore the error.