home · contact · privacy
Add script to daily update the infections table and the website output.
[berlin-corona-table] / update.sh
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