Saturday, 28 March 2020

Command line (CLI) check and monitor COVID-19 statistics

Use the following command to quickly check for COVID-19 (corona virus) statistics from the console (CLI), for the countries you want to monitor.


Command line:
clear && curl -s https://corona-stats.online/?minimal=true | grep "Rank\|(DE)\|(IT)\|(ES)\|(GR)\|(US)\|(AE)\|(GB)\|(CH)\|(AT)\|(NL)"


Modify the command as needed with any valid ISO 3166-1 Alpha-2 Country Codes. 

Thanks goes to @ekrysis for collecting the data sources and providing the means to query the information. See more at GitHub: https://github.com/sagarkarira/coronavirus-tracker-cli 

Some examples:
# Get data from worldometers api i.e source 2
curl https://corona-stats.online

# Get data from source 1
curl https://corona-stats.online?source=1

# Get data from source 2
curl https://corona-stats.online?source=2

# Filter by country /countryCode or /countryName
curl https://corona-stats.online/US
curl https://corona-stats.online/italy
curl https://corona-stats.online/uk?source=2
curl https://corona-stats.online/gb?source=1

# State wise stats of country (Only for US as of now)
curl https://corona-stats.online/US

# Only show top N countries
curl https://corona-stats.online?top=20

# Remove padding and borders from table
curl https://corona-stats.online?minimal=true

# Latest News (Work In Progress)
curl https://corona-stats.online/updates

# Allow emojis (emojis breaks in some terminals)
curl https://corona-stats.online?emojis=true

# Help
curl https://corona-stats.online/help

No comments:

Post a Comment