home · contact · privacy
Use scrape.py to update daily infections instead of unreliable CSV URL.
[berlin-corona-table] / update.sh
1 #!/bin/sh
2 set -e
3
4 table_path=daily_infections_table.txt
5
6 # Re-build infections table.
7 ./scrape.py > "${table_path}"
8
9 # Write enhanced table output to directory served by web server.
10 #
11 # Use intermediate /tmp/ step so we don't overwrite a valid previous output with
12 # the emptiness delivered to stdout on any error, before such an error would
13 # kill this script due to "set -e".
14 ./enhance_table.py "${table_path}" html > /tmp/berlin_corona.html
15 ./enhance_table.py "${table_path}" txt > /tmp/berlin_corona.txt
16 mv /tmp/berlin_corona.html /var/www/html/
17 mv /tmp/berlin_corona.txt /var/www/html/