sagarkarira / coronavirus-tracker-cli Goto Github PK
View Code? Open in Web Editor NEWTrack conronavirus cases from command line. curl https://corona-stats.online/
Home Page: https://corona-stats.online/
Track conronavirus cases from command line. curl https://corona-stats.online/
Home Page: https://corona-stats.online/
Hi guys, is there a way to implement the cli to bring data from yesterday or the day before, and check the evolution of the pandemic?
From https://expressjs.com/en/api.html#app.settings.table:
Enable case sensitivity. When enabled, "/Foo" and "/foo" are different routes. When disabled, "/Foo" and "/foo" are treated the same.
The default is undefined
Just a tip:
Please add the following CSS rules to the in browser for a better look in browsers!
font-family: monospace;
white-space: pre;
The table lists "Mortality %", while I suspect it actually means Case Fatality Rate (CFR):
Mortality rate, or death rate, is a measure of the number of deaths (in general, or due to a specific cause) in a particular population, scaled to the size of that population, per unit of time. Mortality rate is typically expressed in units of deaths per 1,000 individuals per year; thus, a mortality rate of 9.5 (out of 1,000) in a population of 1,000 would mean 9.5 deaths per year in that entire population, or 0.95% out of the total. It is distinct from "morbidity", which is either the prevalence or incidence of a disease, and also from the incidence rate (the number of newly appearing cases of the disease per unit of time).
In epidemiology, a case fatality rate (CFR) โ sometimes called case fatality risk or case fatality ratio โ is the proportion of deaths from a certain disease compared to the total number of people diagnosed with the disease for a certain period of time.
Therefore, "mortality" sets the deaths in perspective to entire population of a given region/country after the fact or within a certain time frame, while the CFR sets the current deaths in perspective to some affected case numbers (diseased people).
Initially reported here
@sagarkarira note that the emojis don't work on Windows
Maybe they should respect the emoji flag like the rest of the code?
Hey, there @sagarkarira, thanks for this!
It appears this doesn't work at all on Windows 10 native cmd. Not sure how hard this would be, I thought I'd report it :)
Pretty much as the title says knowing the actual number of people within a country to compare to infection numbers to gauge overall spread within a country. This data should be available through sources such as wikipedia or the official government pages of the respective countries.
Thanks for this tool, but could you please remove spaces from country names?
E.G. United Kingdom -> could be United_Kingdom or UK
Maybe an interesting feature, but not important:
curl http://corona-stats.online/[countrycode] just displays one country.
curl http://corona-stats.online/[countrycode1]&[countrycode2]... could display more than one country and then a comparision between these countrys / selections is easier
Please Add the data sources used for each country.
Preferably in a table in the README or where we locate it.
Hi,
Any chance you can add the regional data to the UK breakout?
The individual governments upload their data daily around 2pm:
Scotland (has breakdown per region) - https://www.gov.scot/coronavirus-covid-19/
Northern Ireland - https://www.health-ni.gov.uk/news/latest-update-coronavirus-covid-19-4
Wales - https://phw.nhs.wales/news/public-health-wales-statement-on-novel-coronavirus-outbreak/
England (has breakdown per region // click "view" on bottom right to get the CSV file) - https://www.arcgis.com/home/item.html?id=ca796627a2294c51926865748c4a56e8
(other sources for England // UK: https://www.gov.uk/government/publications/covid-19-track-coronavirus-cases)
Hello,
I've been trying to fetch data from Venezuela by it's own (https://corona-stats.online/VE?format=json / https://corona-stats.online/VEN?format=json) but it doesn't provide any answer, barely data: [] and worldStats.
Is this a bug or am I doing it wrong?
I'm getting the following error using source=2
An error occurred with this application. NO_STATUS_CODE_FROM_FUNCTION
502: BAD_GATEWAY
Code: NO_STATUS_CODE_FROM_FUNCTION
ID: arn1:4jhs7-1585237699043-d15b89c01c8e
Can you please add the data sources to the README?
Thanks for your work to help the people in need! Your site has been added! I currently maintain the Open-Source-COVID-19 page, which collects all open source projects related to COVID-19, including maps, data, news, api, analysis, medical and supply information, etc. Please share to anyone who might need the information in the list, or will possibly contribute to some of those projects. You are also welcome to recommend more projects.
http://open-source-covid-19.weileizeng.com/
Cheers!
All states have a 0 recovered and the US total is also 0. However when looking at the source data you are pulling from it has 121 recovered as of today.
$ curl https://corona-stats.online/
curl: (28) Failed to connect to corona-stats.online port 443: Connection timed out
I tried from multiple places.
It seems packets drop.
BNODesk has been covering coronavirus since the start and it gives frequent news updates from the globe.
I think displaying 10 latest tweets from that handle will be helpful.
Feel free to comment.
https://corona-stats.online/ is giving a 502: BAD_GATEWAY error...
Here is more information:
Code: NO_STATUS_CODE_FROM_FUNCTION ID: lax1:vvwp6-1585113998131-f3be88526585
You could add some detailed info about Italy picking up info from here:
http://opendatadpc.maps.arcgis.com/apps/opsdashboard/index.html#/b0c68bce2cce478eaac82fe38d4138b1
Where are your data sources taken from?
For several countries, the data is not up to date with this tool, as it is on their official sites.
Please explain how to fix this.
E.g. For Lithuania:
$ curl https://corona-stats.online/Lithuania?minimal=true
Rank State Confirmed Recovered Deaths Active Mortality % Recovered % 1 Day โฒ 1 Week โฒ
Lithuania Total 83 1 1 81 1.20 1.20 34 โฒ 75 โฒ
Versus:
{"lietuva":{"region":"Lietuva","confirmed":105,"recovered":1,"deaths":1},"alytus":
{"region":"Alytus","confirmed":0,"recovered":0,"deaths":0},"kaunas":
{"region":"Kaunas","confirmed":18,"recovered":0,"deaths":0},"klaipeda":
{"region":"Klaip\u0117da","confirmed":18,"recovered":0,"deaths":0},"marijampole":
{"region":"Marijampol\u0117","confirmed":0,"recovered":0,"deaths":0},"siauliai":
{"region":"\u0160iauliai","confirmed":3,"recovered":1,"deaths":0},"panevezys":
{"region":"Panev\u0117\u017eys","confirmed":2,"recovered":0,"deaths":0},"taurage":
{"region":"Taurag\u0117","confirmed":0,"recovered":0,"deaths":0},"telsiai":
{"region":"Tel\u0161iai","confirmed":0,"recovered":0,"deaths":0},"utena":
{"region":"Utena","confirmed":0,"recovered":0,"deaths":0},"vilnius":
{"region":"Vilnius","confirmed":59,"recovered":0,"deaths":0}}
and
https://corona-stats.online/IT
โโโโโโโโคโโโโโโโโโโโโโคโโโโโโโโโโโโโโโคโโโโโโโโโโโโโโคโโโโโโโโโโโโโโโคโโโโโโโโโโโโโโโคโโโโโโโโโโโโคโโโโโโโโโโคโโโโโโโโโโโคโโโโโโโโโโโโโโโโโ
โ Rank โ Country โ Total Cases โ New Cases โฒ โ Total Deaths โ New Deaths โฒ โ Recovered โ Active โ Critical โ Cases / 1M pop โ
โโโโโโโโผโโโโโโโโโโโโโผโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโผโโโโโโโโโโโโผโโโโโโโโโโผโโโโโโโโโโโผโโโโโโโโโโโโโโโโโข
โ 1 โ Italy (IT) โ 80,589 โ 6,203 โฒ โ 8,215 โ 712 โฒ โ 10,361 โ 62,013 โ 3,612 โ 1 โ
โโโโโโโโผโโโโโโโโโโโโโผโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโผโโโโโโโโโโโโผโโโโโโโโโโผโโโโโโโโโโโผโโโโโโโโโโโโโโโโโข
โ โ World โ 528,637 โ 57,602 โฒ โ 23,956 โ 2,674 โฒ โ 123,364 โ 381,317 โ 19,430 โ 67.83 โ
โโโโโโโโงโโโโโโโโโโโโโงโโโโโโโโโโโโโโโงโโโโโโโโโโโโโโงโโโโโโโโโโโโโโโงโโโโโโโโโโโโโโโงโโโโโโโโโโโโงโโโโโโโโโโงโโโโโโโโโโโงโโโโโโโโโโโโโโโโโ
Stay safe. Stay inside.
Code: https://github.com/sagarkarira/coronavirus-tracker-cli
Twitter: https://twitter.com/ekrysis
Last Updated on: 26-Mar-2020 22:03 UTC
UPDATE: Source 2 is now default source
JHU Source 1 table: https://corona-stats.online?source=1
HELP: https://corona-stats.online/help
The cases per 1 million for italy here are shown as 1
, but it is actually 1,333
on the worldometer website at the time of writing.
Not sure if this is an issue with the api being used or how it is displayed. It could have something to do with the comma?
Hi,
Showing all countries in the list takes up too many pages of the terminal,
but it would still be nice to be able to see more than one country.
My suggestion is two-fold:
curl https://corona-stats.online/X
where X is a number (e.g. 20 for "top 20" countries by number of cases)
and/or:
curl https://corona-stats.online/REGION
where region could be like Europe, Scandinavia, Caribbean, Mediterranean, Asia, Oceania, or whatever.
Or just being able to to manually put together a list would be fine too:
curl https://corona-stats.online/SE+DK+NO+FI+IS
for Scandinavia.
Anyways, awesome curl app. Keep up the great work!
Regards,
-F
I'm getting the following error when trying to get the graph
I am sorry. Something went wrong. Please report it Cannot read property 'latest' of undefined =================
I can make a PR later if you agree with this @sagarkarira
Perhaps hourly / every two hours? So far it's the best tool out there except for the severely outdated information.
Hello,
thank's for your job.
I think it is useful to indicate the date and time of the last update of the data.
Your source reports this information in the "last_updated" field, it would be enough to report it in the output.
Thanks
I'm pretty sure that earlier today when I put the URL in my browser, I got all the colors. But now I only get that terrible green.
@sagarkarira Did you change something? (It was nice to have that in the browser as well.)
so when i run curl https://corona-stats.online
on windows i get this.
havent realy used curl on windows before.
StatusCode : 200
StatusDescription : OK
Content : <!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Coronavirus Tracker</title>
<style>
...
RawContent : HTTP/1.1 200 OK
Connection: keep-alive
access-control-allow-origin: *
access-control-allow-headers: X-Requested-With, Content-Type, Accept
access-control-allow-methods: GET, POST, PUT, DELETE, OPT...
Forms : {}
Headers : {[Connection, keep-alive], [access-control-allow-origin, *], [access-control-allow-headers,
X-Requested-With, Content-Type, Accept], [access-control-allow-methods, GET, POST, PUT,
DELETE, OPTIONS]...}
Images : {}
InputFields : {}
Links : {}
ParsedHtml : System.__ComObject
RawContentLength : 102589
When you run the express server locally, you get colors because I am not stripping ANSI codes. But when you deploy to Zeit now, colors are not coming. Maybe because they are stripping ANSI codes.
I am not able to figure this out. If anyone has any idea please let me know.
I used to be able to get a breakdown by each US State (e.g. Illinois, Michigan, New York, etc.,) with https://corona-stats.online/US. Now it just shows the total data for the country instead.
https://corona-stats.online/?source=2&format=json shows the green/black website instead of the raw json text.
When parsing the json format (https://corona-stats.online/?format=json), it appears that the deathsByDay and recoveredByDay are identical values.
Tested for France and China, using R and jsonlite.
Maybe I am doing something wrong.
But when I fetch the following URL, I do not the total world wide data.
https://corona-stats.online/?format=json
The first Entry in the JSON list is China.
Without ?format=json
it looks god.
Awesome tool!
I don't understand the numbers inside these arrays. Do each index represent something? It looks like it pertains to a single day
. However, I'm not sure what the start date is or reference starting date.
Here's an example where input is Philippines. It's just a snippet from the complete json output
"confirmedByDay": [
0,
0,
0,
0,
0,
0,
0,
0,
1,
1,
1,
2,
2,
2,
2,
2,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
3,
5,
6,
10,
20,
33,
49,
52,
64,
111,
140,
142,
187,
202,
217,
230,
307,
380
],
Thanks!
when using corona <country> --graph
, <country>
is ignored. The graph is always shown for World.
I submitted #84 to fix it.
Currently favicon.ico returns a 404. Would be nice to have a favicon.ico, even a dummy one :)
Hello,
I've tried to use the APIs for both sources, but each have their issues:
Source 1:
Source 2:
The URL I use for fetching data is "https://corona-stats.online?format=json&top=10&source=X", where X is 1 or 2.
Since the first API doesn't report recovered cased, I tried to use the second API. But in the second API, it's not possible to get the data from the previous day. The first API had it and it was quite useful...
Hello,
I really love your project but the recent changes made it unuable with curl
.
Is it possible to remove the HTML
when call from curl
? Is can be done easily by reading the user-agent
header.
Thanks for your work.
after running command corona 'country name', it shows the entire table without filtering out country specific info. I think there is problem with bycountry.js
I am seeing a lot of requests coming from web browsers.
Sadly I am sending ASCII table which is meant for terminal and is not rendered properly in the browser.
I think creating a simple minimalistic Html table will do the job for these users.
I will pick this up on weekend but if anyone is interested, just let me know.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.