https://twitter.com/vaccinetime/
This bot checks Massachusetts vaccine appointment sites every minute and posts on Twitter when new appointments show up. The bot is written in Ruby.
The following websites are currently checked:
- maimmunizations - every site
- CVS pharmacies in MA
- Lowell General Hospital
- BMC
- UMass Memorial
- SBCHC
- Lawrence General Hospital
- Martha's Vineyard Hospital & Nantucket VFW
- Tufts Medical Center Vaccine Site
- Zocdoc
- Southbridge Community Center
- Trinity Health of New England
- Southcoast Health
- Northampton
- Rutland
- Heywood Healthcare
- Vaccinespotter - Pharmacies other than CVS
- Pediatric Associates of Greater Salem
- Costco
- Hannaford
- Color - Lawrence General Hospital
- Amesbury
- Holyoke Health
The following websites have moved onto the Massachusetts preregistration system, so their scrapers have been disabled:
- https://curative.com - DoubleTree Hotel in Danvers, Eastfield Mall in Springfield, and Circuit City in Dartmouth
- https://home.color.com - Natick Mall, Reggie Lewis Center, Gillette Stadium, Fenway Park, Hynes Convention Center
A Dockerfile is provided for easy portability. Use docker-compose to run:
docker-compose up
This will run the bot without tweeting, instead sending any activity to a "FakeTwitter" class that outputs to the terminal. To set up real tweets, see the configuration section below.
Logs are stored in files in the log/
directory, and any errors will terminate
the program by default and print the error trace. Set the environment variable
ENVIRONMENT=production
to keep running even if an error occurs (errors will
still get logged).
The bot uses Redis for storage and Chrome or Chromium for
browser automation. If you wish to run the bot locally, install Chrome/Chromium
and Redis, and run redis locally with redis-server
. Finally install the ruby
dependencies with:
bundle install
bundle exec ruby run.rb
You can optionally run a subset of scrapers by providing an option -s
or
--scrapers
to the run.rb
script like this:
bundle exec ruby run.rb -s ma_immunizations,cvs
Running locally works fine on MacOS, but hasn't been tested elsewhere.
Configuration is done via environment variables that are passed into docker at runtime. To enable tweeting, provide the following:
- TWITTER_ACCESS_TOKEN
- TWITTER_ACCESS_TOKEN_SECRET
- TWITTER_CONSUMER_KEY
- TWITTER_CONSUMER_SECRET
This bot can also be configured to send slack notifications to a channel by setting the following environment variables:
- SLACK_API_TOKEN
- SLACK_CHANNEL
- SLACK_USERNAME
- SLACK_ICON
Additional configuration can be done with the following:
- SENTRY_DSN - sets up error handling with Sentry
- ENVIRONMENT - configures Sentry environment and error handling
- UPDATE_FREQUENCY - number of seconds to wait between updates (default 60)
- SEED_REDIS - set to true to seed redis with the first batch of found appointments (useful for deploying to fresh redis instances)
All modules allow for site specific configuration by setting environment variables based on the module name. For example, to set MaImmunizations configuration, use:
- MA_IMMUNIZATIONS_TWEET_THRESHOLD
- MA_IMMUNIZATIONS_TWEET_INCREASE_NEEDED
- MA_IMMUNIZATIONS_TWEET_COOLDOWN
Defaults can be set for non-pharmacy sites using:
- DEFAULT_TWEET_THRESHOLD
- DEFAULT_TWEET_INCREASE_NEEDED
- DEFAULT_TWEET_COOLDOWN
Defaults can be set for pharmacies using:
- PHARMACY_DEFAULT_TWEET_THRESHOLD
- PHARMACY_DEFAULT_TWEET_INCREASE_NEEDED
- PHARMACY_DEFAULT_TWEET_COOLDOWN
See CONTRIBUTING.md for details on how to contribute. We expect external contributors to adhere to the code of conduct.
Copyright 2021 Ginkgo Bioworks
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.