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_phrase
orneg_phrase
.cvs
: Queries thecvs.com
website with with thestate
andcity
parameters supplied.heb
: Queries theheb.com
website with with thecity
parameter supplied.walgreens
: Queries thewalgreens.com
website with with thequery
parameter 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
import
s ofvaccineChecker.py
(a.k.a.pip install....
) - if you include
walgreens
as a type inwebsites.json
, you need theselenium
Python package and the Linux Firefoxgeckodriver
driver for the OS. The script assumes thegeckodriver
binary 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 includingwalgreens
as 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-rate
argument, create your owncredentials.json
file and pass it to the script with--credentials
. See README invaccineChecker.py
for format. This is optional. - modify
input/websites.json
for the websites you wish to monitor - run
vaccineChecker.py
as a background task
- if you would like notifications to an email with script status to be sent, as enabled by the
- after running
vaccineChecker.py
at least once, so it createsstatus/status.json
, create a new directory to be served by the webserver. within this new directory, create softlinks toindex.php
andstatus.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.php
on your site! debug, test, repeat!