home · contact · privacy
Move sum_district to the left, as it's of more interest than others.
[berlin-corona-table] / update.sh
index 1bfd38b29e667b9ed4b079afc75a347fb467ded4..57ecf89d056395bf704c3ead01f945d118c7a597 100755 (executable)
--- a/update.sh
+++ b/update.sh
@@ -1,21 +1,22 @@
 #!/bin/sh
 set -e
 
-CSV_URL=https://www.berlin.de/lageso/_assets/gesundheit/publikationen/corona/bezirkstabelle.csv 
-table_path=/home/plom/berlin-corona-table/daily_infections_table.txt
+CSV_URL=https://www.berlin.de/lageso/_assets/gesundheit/publikationen/corona/bezirkstabelle.csv
+table_path=daily_infections_table.txt
 
 # If we don't have a table file yet, we need to provide its header.
 header="            CW  FK  Li  MH  Mi  Ne  Pa  Re  Sp  SZ  TS  TK sum"
-if [ ! -f "${table_path}" ]; then 
+if [ ! -f "${table_path}" ]; then
     echo  "${header}" > "${table_path}"
 fi
 
-# Parse Lageso day table of new infections by district into new line for history table. 
+# Parse Lageso day table of new infections by district into new line for history table.
 today="$(date +%Y-%m-%d)"
 curl "${CSV_URL}" \
 | awk 'BEGIN { FS=";"; ORS=""; print "'${today}'" }; '\
 '!/^Bezirk/ { printf "%4d", $3 }; '\
-'END { printf "\n" }' "${filename}" >> "${table_path}" 
+'END { printf "\n" }' "${filename}" >> "${table_path}"
 
 # Write enhanced table output to directory served by web server.
-./enhance_table.py "${table_path}" > /var/www/html/berlin_corona.txt
+./enhance_table.py "${table_path}" txt > /var/www/html/berlin_corona.txt
+./enhance_table.py "${table_path}" html > /var/www/html/berlin_corona.html