Created
January 27, 2021 09:03
-
-
Save spinscale/7bb467a60c5e883abe42ea8bbdf2faff to your computer and use it in GitHub Desktop.
Revisions
-
spinscale created this gist
Jan 27, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,29 @@ #!/bin/bash # retrieve URL url="https://www.rki.de/DE/Content/InfAZ/N/Neuartiges_Coronavirus/Daten/Impfquotenmonitoring.xlsx?__blob=publicationFile" wget -o /dev/null $url -O out.xlsx # convert to csv # run 'pip3 install xlsx2csv' (or maybe pip depending on your python installation) xlsx2csv -a out.xlsx out.csv # figure out the number of days we got vaccination data # exclude those with no vaccination happening days=$(grep -c '^[01][0-9].*,[1-9]\d*,\d*,\d*' out.csv/Impfungen_proTag.csv) # extract the total number of vaccinations total_first_vaccinations=$(grep ^Gesamt, out.csv/Impfungen_proTag.csv| cut -d',' -f2) # average vaccinations per day so far, multiply with 1.0 to get floats average_vaccinations_per_day=$(echo "scale=2;$total_first_vaccinations/$days" | bc -l) # figure out how many days we need to wait for everyone to be vaccinated population=83000000 days=$(echo "scale=0;$population/$average_vaccinations_per_day" | bc) years=$(echo "scale=2;$days/365.0" | bc) RED='\033[0;31m' NC='\033[0m' echo -e "Days until full vaccination: ${RED}$days${NC} (aka ${RED}$years${NC} years)"