CLI to check for Covid Vaccine appointments pincode or district wise and get notified on WhatsApp/Telegram.
- Python 3.6+ , you can install it from https://www.python.org/downloads/
- Either Telegram Account (Recommended)
- Or Twilio Free Trail Account for whatsapp notification
- On Telegram, search @BotFather, click on START button or send
/start
message - Send
/newbot
message and follow the instructions to set the name and username for your bot - You will receive a token to access HTTP API, this token is your
TELEGRAM_BOT_TOKEN
- Goto your bot name in Telegram and send
/start
message - To get your chatId Open a new tab in browser, enter
https://api.telegram.org/bot<token>/getUpdates
You will get the response as"ok":true,"result":[{"update_id":334363465, "message":{"message_id":3,"from":{"id":130XXXXXX,"is_bot":false,"first_name":"Vinay", "language_code":"en"}, "chat":{"id":130XXXXXX,"first_name":"Vinay","type":"private"},"date":1620703638,"text":"/start", "entities":[{"offset":0,"length":6,"type":"bot_command"}]}}]}
TELEGRAM_BOT_CHAT_ID
will be130XXXXXX
from the above response - Export the following env variables on your terminal
export TELEGRAM_BOT_TOKEN=<from step 3 above>
export TELEGRAM_BOT_CHAT_ID=<from step 5 above>
Note: This method will send notification to your bot which will only be visible to you
- Create a new channel on Telegram and make custom bot created above as admin
- Got to https://web.telegram.org/#/im and select the channel created
- In the web url you will see something like https://web.telegram.org/#/im?p=c115xxxx_1234567890
- Copy the number before
_
likec115xxxx
and remove the starting characterc
- Prefix
-100
to this number as-100115xxxx
- Export the following variable
export TELEGRAM_BOT_TOKEN=<from step 3 of Telegram Bot Configuration>
export TELEGRAM_BOT_CHAT_ID=-100115xxxx
Note: Using this method you will notify all the members of your channel
- Create a new Twilio Trail Account - www.twilio.com/referral/PfBNJy
- Follow the steps here https://www.twilio.com/console/sms/whatsapp/sandbox
- Export the following env variables on your terminal
export TWILIO_ACCOUNT_SID="twilio_account_sid" // you will get this here https://www.twilio.com/console
export TWILIO_AUTH_TOKEN="twilio_auth_token" // you will get this here https://www.twilio.com/console
export FROM_MOBILE_NUMBER="twilio_number" // you will get this number after following the steps https://www.twilio.com/console/sms/whatsapp/sandbox
export TO_MOBILE_NUMBER="your_mobile_number"
Note: Twilio Sandbox lasts for 72 hours after which notification to whatsapp will not come. You will have to again join the sandbox
- Download release directly by clicking on slotinfo-1.3.tar.gz here - https://github.com/veenaypatil/Vaccine-Slot-Info/releases/tag/v1.3
sudo pip install <downloaded_folder>/slotinfo-1.3.tar.gz
or
sudo pip3 install <downloaded_folder>/slotinfo-1.3.tar.gz
Checkout how to install pip here - https://www.techgeekbuzz.com/how-to-install-python-pip-on-windows-mac-and-linux/
- Or Clone the code and install
python setup.py sdist
sudo pip install dist/slotinfo-1.3.tar.gz
continuously-for-district
continuously-for-district-next7days
continuously-for-pincode
continuously-for-pincode-next7days
district-wise
district-wise-next7days
pincode-wise
pincode-wise-next7days
get-district-id
get-state-id
1. Get the State ID
slotinfo get-state-id --state_name Maharashtra
2. Get the District ID
slotinfo get-district-id --state_id 21 --district_name Pune
3. Check available appointment slots district wise
slotinfo district-wise --district_id 334 --date 10-05-2021 --age_filter 18 --notify_on whatsapp --vaccine_type covishield --vaccine_type covaxin --dose_number 1
4. Check available appointment slots district wise for next 7 days
slotinfo district-wise-next7days --district_id 334 --date 10-05-2021 --age_filter 18 --notify_on whatsapp --vaccine_type covishield --vaccine_type covaxin --dose_number 2
5. Check available appointment slots pincode wise
slotinfo pincode-wise-next7days -pin 411015 --date 10-05-2021 --age_filter 45 --notify_on telegram --vaccine_type covishield --vaccine_type covaxin --dose_number 1
6. Check available appointment slots pincode wise
slotinfo pincode-wise -pin 411015 --date 10-05-2021 --age_filter 45 --notify_on telegram --vaccine_type covishield --vaccine_type covaxin --dose_number 1
7. Run the cmd continously to check for available appointments in a district after evey x(seconds) interval
slotinfo continuously-for-district --district_id 363 --date 10-05-2021 --age_filter 18 --interval 2 --notify_on telegram --vaccine_type covishield --vaccine_type covaxin --dose_number 1
8. Run the cmd continously to check for available appointments in a district for next 7 days after evey x(seconds) interval
slotinfo continuously-for-district-next7days --district_id 363 --date 10-05-2021 --age_filter 18 --interval 2 --notify_on telegram --vaccine_type covishield --vaccine_type covaxin --dose_number 2
9. Run the cmd continously to check for available appointments in pin code after evey x(seconds) interval
slotinfo continuously-for-pincode --pin_code 41105 --date 10-05-2021 --age_filter 18 --interval 2 --notify_on whatsapp --vaccine_type covishield --vaccine_type covaxin --dose_number 1
10. Run the cmd continously to check for available appointments in pin code for next 7 days after evey x(seconds) interval
slotinfo continuously-for-pincode-next7days --pin_code 411015 --date 10-05-2021 --age_filter 18 --interval 2 --notify_on whatsapp --vaccine_type covishield --vaccine_type covaxin --dose_number 2
Note: --vaccine_type
, dose_number
and age_filter
are optinal fields
To get the help of any command use --help
option with command name
Usage: slotinfo continuously-for-district-next7days [OPTIONS]
Continuously check for available slots in district for next 7 days after
every x interval seconds and notify on whatsapp/telegram
Options:
-dId, --district_id TEXT Provide district Id to check for
appointments [required]
-d, --date TEXT Date for which appointments are to be
checked for next 7 days [required]
-af, --age_filter [18|45] Filter only 18 plus or 45 plus appointments
-i, --interval INTEGER Interval in seconds [required]
-n, --notify_on [whatsapp|telegram]
Receive notification on whatsapp/telegram
[required]
-vt, --vaccine_type [covishield|covaxin]
Vaccine type for which appointments are to
be checked
-dn, --dose_number [1|2] Dose number for which appointments are to be
checked
--help Show this message and exit.