Go to file
nein.wtf 9fd8fdac31 Add note about officially confirmed numbers vs estimated true numbers 2022-05-05 09:18:25 +02:00
.gitattributes Exclude *.com files from gitea language stats 2022-03-02 08:01:33 +01:00
.gitignore Initial commit 2022-02-17 15:12:03 +01:00
LICENSE Add license 2022-02-24 15:13:26 +01:00
README.org Be a bit more detailed about deployment 2022-03-02 08:06:39 +01:00
index.lua Add note about officially confirmed numbers vs estimated true numbers 2022-05-05 09:18:25 +02:00
redbean.com Add note about officially confirmed numbers vs estimated true numbers 2022-05-05 09:18:25 +02:00
sqlite3.com Initial commit 2022-02-17 15:12:03 +01:00
update-data.sh Fix ordering quirk in update script 2022-03-02 08:10:50 +01:00

README.org

Dimensions of Covid

Fuck this. Millions of people have died of COVID and probably there are millions more to come. Instead of a coordinated effort of keeping the global suffering as small as possible, most of the energy goes towards squeezing the last bit out of collective organization so that already powerful countries can be kept running and get an edge in the post-pandemic economic recovery. Early pandemic hopes that it could lead to a significant and lasting disruption of business-as-usual seem infinitely far away while the abolition of health protective measures is discussed even in regions with hundreds or thousands of people suffering and dying each day.

How does it work

In regular intervals, update-data.sh fetches the current covid data from https://covid-19.datasettes.com, which provides data by the Johns Hopkins university, using the following query:

select day, last_update, sum(deaths) sum_deaths
from johns_hopkins_csse_daily_reports
where country_or_region not like '%Olympics%'
group by day
order by day desc
limit 1

This provides an up-to-date approximation of total covid 19 deaths. In a somewhat backwards manner this is saved in a CSV, which is then again imported into an SQLite database. The database is queried in index.lua, where a single HTML page is created as a response.

Bundling

Just add it all to the redbean executable:

nix run nixpkgs#zip -- redbean.com *.lua

The executable can just be put somewhere and run, and the update script should be run regularly:

rsync -rztsv --info=progress2 redbean.com sqlite3.com update-data.sh ...
# crontab -e ...

Note that there were some problems deploying the executable to uberspace, which could be resolved by using redbean-unsecure.com, which comes without built-in SSL support.