A Twitter Bot for COVID Vaccine Availability in New York City
The other day I stopped to think about the collective time and energy that’s been wasted from people refreshing vaccine booking portals trying to book appointments for themselves or their loved ones.
A few months ago when COVID vaccines were first becoming available in New York, I built a web scraper to constantly check the Walgreens, CVS, and New York State vaccine portals for available appointments. If it found one, it would send me an SMS via the Twilio API. This was incredibly useful, and I managed to snag at least one appointment for a family member early on. But then I let it sit for a few weeks. As you can imagine, vaccine distributers are constantly updating and changing their booking systems whether it be to fix issues or to fit the ever-changing demands. This ultimately led to my script no longer working well enough to be useful.
I decided to do some poking around to see if there was a better way and not long after, I came across the ArcGIS page for the API that powers vaccinefinder.nyc.gov. It didn’t take long after that to spin up a Twitter bot to spit out the information.
Vaccine appointments are available at
— NYC Vaccine Bot (@nyc_vaccine) March 26, 2021
NYC Vaccine Hub - Essex Crossing (Moderna)
244B Broome Street, Manhattan, NY, 10002https://t.co/g7udiCIGur
The code itself is pretty simple. We use node-fetch
to read the vaccine data, and the twit
package to interact with the Twitter API.
I’m running this in Docker on a node 14.x image using docker-compose
.