sagarkarira / coronavirus-tracker-cli

Track conronavirus cases from command line. curl https://corona-stats.online/

Home Page:https://corona-stats.online/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

error cannot read property 'latest' of undefined

devianpctek opened this issue · comments

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 =================

Same for me. https://corona-stats.online give the same error.

I thought I'd be faster. +1

Edit: In such case please do not return HTTP 200

Sorry, working on it.
Use source 2 till that time [https://corona-stats.online/?source=2](https://corona-stats.online/?source=2]

Is source=2 supposed to have different json schema?

@MarcinWieczorek I have made source 2 as a default one for now. When I fix JHU I will change it back. Yes it has a different schema. Historical cases and state-wise data is not available in source 2.

Yeah I understand that some data is not available, but keys such as cases in source 2 and confirmed in source 1 should be unified, right?

Same for me.

URL: https://corona-stats.online/argentina/graph
Output: I am sorry. Something went wrong. Please report it Cannot read property 'latest' of undefined

I've fixed this. They have removed recovered so I am thinking of making source 2 as default source. What do you think?

I'm against changing json schema, you'd break people's scripts. Unify it and then change. I'm for the change because current source's data is quite delayed due to daily updates.

I will try to add similar keys as in source 1 to source 2 data wherever I can. Then I would change it to default.
JHU does not provide a real-time API and also keep changing their data uploaded to Github. They have also removed the US state-level data and now they are uploading it separately.

Whenever I do this change I will add this to footer.

Thank you for your time and effort!

Made source 2 a default source.
US state-level data was also removed from JHU. I found an API source. Will add it tomorrow.

so the error is not longer showing, closing this