This project is used to show availablity of the COVID-19 vaccine in San Antonio, TX at the website http://sanantoniovaccine.com. It can be adapted for other cities.
Vaccine provider websites in a configuration file are periodically queried by a Python script to look for current availability. The status is written to a file, which is then ready by a PHP file for display on a website.
index.php is the website, vaccineChecker.py is the background task for querying the websites. See respective README information at the top index.php / vaccineChecker.py, along with vaccineChecker.py --help.
An example file input/websites.json is provided in this source tree. The sites in websites.json can be one of four type values:
phrase: Looks for the presence or absence of phrases specified bypos_phraseorneg_phrase.cvs: Queries thecvs.comwebsite with with thestateandcityparameters supplied.heb: Queries theheb.comwebsite with with thecityparameter supplied.walgreens: Queries thewalgreens.comwebsite with with thequeryparameter supplied.
The setup is not a one-click-easy-button, but it's not too complicated:
- have a Linux server with:
- PHP (v5.5 known to work)
- Python (v3.4.3 known to work)
- Python dependencies in the
imports ofvaccineChecker.py(a.k.a.pip install....) - if you include
walgreensas a type inwebsites.json, you need theseleniumPython package and the Linux Firefoxgeckodriverdriver for the OS. The script assumes thegeckodriverbinary is in the path. See https://askubuntu.com/questions/851401/where-to-find-geckodriver-needed-by-selenium-python-package for setup. If you are not includingwalgreensas a type, you don't need this.
- download and extract a copy of this repository to a location NOT served by the web server. example:
/home/[your-user]/savaccine/
.gitignore
LICENSE
README.md
index.php
vaccineChecker.py
input/
README.md
websites.json
status/
README.md
- in the extracted directory:
- if you would like notifications to an email with script status to be sent, as enabled by the
--notification-rateargument, create your owncredentials.jsonfile and pass it to the script with--credentials. See README invaccineChecker.pyfor format. This is optional. - modify
input/websites.jsonfor the websites you wish to monitor - run
vaccineChecker.pyas a background task
- if you would like notifications to an email with script status to be sent, as enabled by the
- after running
vaccineChecker.pyat least once, so it createsstatus/status.json, create a new directory to be served by the webserver. within this new directory, create softlinks toindex.phpandstatus.json. example:
/var/www/html/savaccine/
index.php -> /home/[your-user]/savaccine/index.php
status.json -> /home/[your-user]/savaccine/status/status.json
- view
index.phpon your site! debug, test, repeat!