Initial commit
This commit is contained in:
commit
ba520da43e
6 changed files with 85 additions and 0 deletions
10
update-data.sh
Executable file
10
update-data.sh
Executable file
|
|
@ -0,0 +1,10 @@
|
|||
#!/usr/bin/env bash
|
||||
set -ex
|
||||
|
||||
curl 'https://covid-19.datasettes.com/covid.csv?sql=select+day%2C+last_update%2C+sum(deaths)+sum_deaths%0D%0Afrom+johns_hopkins_csse_daily_reports%0D%0Awhere+country_or_region+not+like+%27%25Olympics%25%27%0D%0Agroup+by+day%0D%0Aorder+by+day+desc%0D%0Alimit+7%0D%0A&_header=off' > covid_deaths.csv && \
|
||||
./sqlite3.com covid_deaths.db \
|
||||
'pragma journal_mode = "wal"' \
|
||||
'create table if not exists covid_deaths(day text, last_update text, sum_deaths integer)' \
|
||||
'.mode csv' \
|
||||
'.import covid_deaths.csv covid_deaths' \
|
||||
'delete from covid_deaths where rowid not in ( select max(rowid) from covid_deaths group by day )'
|
||||
Loading…
Add table
Add a link
Reference in a new issue