remove unnecessary test file
add link to website back in sms body
Fix README to use fenced code block
This tool sends a text message to the number in ./phone-number.txt
using the
Textbelt API with a NY CVS location that has available appointments
from the list of locations in towns.txt
.
This script allows you to repeatably refresh the CVS COVID-19 vaccine page to see what locations have vaccines available. This does not book a vaccine appointment. Instead, it sends a text message with the sign-up link and which location had available bookings. I built this for my senior parents who could not possible refresh the CVS website consistently or correctly. It's recommended that you run this on a cronjob that isn't too frequent that it exhausts the API endpoint or too infrequently where it could possibly miss an available booking.
This project does not allow users of it to skip the vaccination line. You will still need to sign-up manually through the CVS website in order to get a vaccine appointment.
The following files are required:
Once you've created those files, you have to populate them with the expected values. Some of these values can be gleaned from the Inspector Tools > Network tab when the state is picked on the web page.
This is a newline-delimited list of the towns in NY that you would like to set an alert for. eg.
WOODSTOCK
ALBANY
NEW ROCHELLE
OSWEGO
This is a numerical phone number without any other characters. eg. 5551234567
.
This is an API key provided by Textbelt.
This is a URL that CVS uses on modal open to retrieve the JSON result for a given state.
The User-Agent:
header used by your browser for the initial request.
The Referer:
header used by your browser for the initial request.
The Cookie:
header used by your browser for the initial request.
If you're more of a visual learner, here's an example of the necessary config files in a gist you can download and populate yourself.
It's possible to support other states without much modification to the main
logic to the script. The API endpoint should contain a two-letter abbreviation
for the state you are looking for info on. By modifying that value to another
two-letter abbreviation for a given state, the results should change to that
given state. You need to modify the jq
statement to use the new two-letter
abbreviation for the API call.