Last active
April 8, 2021 19:56
-
-
Save Goobaroo/479fcc2bcb7639c0d62c9a7e55ab351c to your computer and use it in GitHub Desktop.
Days until Ontario Vaccinated
This file contains 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 characters
function covid { | |
total=$(curl -s "https://data.ontario.ca/api/3/action/datastore_search?sort=report_date+desc&limit=1&resource_id=8a89caa9-511c-4568-af89-7f2174b4378c" | jq '.result.records[].total_doses_administered' | tr -d '",') | |
rate=$(curl -s "https://data.ontario.ca/api/3/action/datastore_search?sort=report_date+desc&limit=1&resource_id=8a89caa9-511c-4568-af89-7f2174b4378c" | jq '.result.records[].previous_day_doses_administered' | tr -d '",') | |
rdate=$(curl -s "https://data.ontario.ca/api/3/action/datastore_search?sort=report_date+desc&limit=1&resource_id=8a89caa9-511c-4568-af89-7f2174b4378c" | jq '.result.records[].report_date' | tr -d '",') | |
(( days = (11971129 - $total) / $rate )) | |
echo Report: $rdate | |
echo Total: $(printf "%'.f\n" $total) Daily: $(printf "%'.f\n" $rate) | |
echo $days days until vaccinated | |
date -v+${days}d | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment