Skip to content

Instantly share code, notes, and snippets.

View Goobaroo's full-sized avatar

Jason McLeod Goobaroo

View GitHub Profile

Keybase proof

I hereby claim:

  • I am goobaroo on github.
  • I am jasonml (https://keybase.io/jasonml) on keybase.
  • I have a public key ASCA3xRb2IIfQmNud_Fpq30Cpy7z25Syuqq-FOOZuyBHFgo

To claim this, I am signing this object:

@Goobaroo
Goobaroo / covid_ontario.zsh
Last active April 8, 2021 19:56
Days until Ontario Vaccinated
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
}