Small monitoring script for the impfterminservice.de website.
The impftermin_runner.py
script does the following:
- Open appointment 1 URL
- Check availability for appointment 1
- if true, open appointment 2 URL
- Check availability for appointment 2
- if true, send email
There are three ways how you can run the script to get notifications:
- Ad-hoc execution
- cron execution (scheduled)
- Debian package installation (systemd triggered)
Below are the steps for each:
You have to install some dependencies to make the script work (on Ubuntu):
sudo apt install python3-yaml python3-selenium chromium-browser chromium-chromedriver
or via pip (hint: this is not enough if you want to install the Debian package due to root scope):
pip3 install -r requirements.txt
In order to work properly, you must create a config file for your credentials.
A file config.yml
has to be created to read configurations. Here is an example:
url_1: https://002-iz.impfterminservice.de/terminservice/suche/xxxx-xxxx-xxxx/76287/L920
url_2: https://002-iz.impfterminservice.de/terminservice/suche/xxxx-xxxx-xxxx/76287/L920/xxxx-xxxx-xxxx
smtp_server: 'smtp.office365.com'
smtp_port: 587
smtp_user: '[email protected]'
smtp_pw: 'pw123'
to_email: '[email protected]'
from_email: '[email protected]'
Store the file in project directory.
After cloning and creation of the config file, the script can be easily executed by running
python3 impftermin_runner.py
You can also schedule the script to run e.g. every 10 minutes by adding a cron (via crontab -e
)
# add the following line at the end of the file
*/10 * * * * DISPLAY=:0 python3 /path/to/impftermin_runner.py
You can also schedule the script to run e.g. every 5 minutes by adding a GitHub Action. There is one configured in the .github/workflows/
folder.