home · contact · privacy
Add script to daily update the infections table and the website output.
authorChristian Heller <c.heller@plomlompom.de>
Tue, 30 Jun 2020 21:21:01 +0000 (23:21 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Tue, 30 Jun 2020 21:21:01 +0000 (23:21 +0200)
update.sh [new file with mode: 0755]

diff --git a/update.sh b/update.sh
new file mode 100755 (executable)
index 0000000..a136185
--- /dev/null
+++ b/update.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+# Parse Lageso day table of new infections by district into new line for history table. 
+today="$(date +%Y-%m-%d)"
+curl https://www.berlin.de/lageso/_assets/gesundheit/publikationen/corona/bezirkstabelle.csv \
+| awk 'BEGIN { FS=";"; ORS=""; print "'${today}'" }; '\
+'!/^Bezirk/ { printf "%4d", $3 }; '\
+'END { printf "\n" }' "${filename}" >> /home/plom/meldetabelle/daily_infections_table.txt
+
+# Write enhanced table output to directory served by web server.
+./enhance_table.py > /var/www/html/berlin_corona.txt