WhatsApp Bot
Whatsapp Bot for CoWIN vaccination (with automated CAPTCHA verification)
Install
go get github.com/pkjmesra/whatsapp-bot
Getting Started on your PC/Mac
$ go build && go install && mv $GOPATH/bin/whatsapp-bot ./whatsapp-bot
$ ./whatsapp-bot -i 30
- i gives the interval to ping and poll for available vaccination slots for a given set of parameters
- m can help setup a specific mobile number for which you'd like to book an appointment via whatsapp
When you run, your mobile/whatsapp will become the host for sending/receiving data with [91MobileNumber].
-
On your mobile phone, launch whatsapp and send a "subscribe" message to yourself or ask your friend to send a "subscribe" message to your number. (The same number with which you've logged in into whatsapp-bot)
-
Every API call is automated for CoWIN.
-
OTP is sent to your mobile <91MobileNumber>. Enter it in whatsapp when prompted or follow the instructions below to automatically have it entered.
-
CAPTCHA will be sent on whatsapp itself. Enter CAPTCHA to proceed for appointment if not autodetected. In 95% of the cases, CAPTCHA will be autodetected and entered.
Entire transaction can be finished in : time taken for OTP + time taken for CAPTCHA (if not detected automatically).
Getting Started on Android
On your Android phone having the whatsapp running with the same number with which you logged in in the previous step, please do the following setup for OTP.
By using Tremux you can run script and receive the notification on your phone.
When OTP is received, it will launch whatsapp on your mobile to send it to the number with which it was launched on the PC/Mac.
Now open Whatsapp on your Android and send type : subscribe and send it to the same number with which you have logged in on the whatsapp-bot on your Mac/PC.
Enjoy!
-
Subscribe to getting notified
-
Setting up your search parameters
-
Saving your search parameters and confirming
-
Receiving your registered beneficiaries
-
Receiving the notification when the slots become available
-
Trying to book the appointment and receive the confirmation or message if it could not be booked.
After launching, app will create a WhatsApp connection. If you are not logged in, it will print a QR code in the terminal. Scan it with your phone and you are ready to go!
Bot will remember the session (TempDir > pkBot > Session > WhatsappSession.gob) so there is no need to authenticate everytime.