garrylachman / covid19-cli

Corona Virus (Covid 19) BASH Tracking CLI
MIT License
91 stars 16 forks source link

Countries with subtitle not parsing correctly #15

Open mbrehon opened 4 years ago

mbrehon commented 4 years ago

command line: ~/covid19-cli $ ./dist/covid19-cli.sh -l --sort deaths

rough description: Country subtitles(?) are displayed under "cases" column and all remaining values for those countries seem to be shifted one column to the right in display.

output snippets:

| China | 81285 | 3947 | 1235 | 3287 | 74051 | 67 | 6 | 56 |
| Iran | Islamic Republic of | 29406 | 16715 | 2746 | 2234 | 10457 | 2389 | 157 | 350 | | France | 29155 | 22511 | 3375 | 1696 | 4948 | 3922 | 365 | 447 |

| Andorra | 224 | 220 | 6 | 3 | 1 | 36 | 2 | 2 |
| Macedonia | the former Yugoslav Republic of | 201 | 195 | 1 | 3 | 3 | 24 | 0 | 96 | | Congo | the Democratic Republic of the | 51 | 48 | 0 | 3 | 0 | 3 | 1 | 0.6 | | Russia | 840 | 799 | 8 | 3 | 38 | 182 | 0 | 6 |

editing to add:

edit(2) to add '-l' to cmd line above

LinuxOnTheDesktop commented 4 years ago

The following - generated by the latest git code (I updated that code just now) - might result from the same problem.

~/git/covid $ covid us
 ✔  Country: us

Cases:      85594   ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▂▂▃▃▄▅▆█
Deaths:     1300    ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▂▂▂▃▄▅▆█
Recovered:  1868
~/git/covid $ covid "united states"
 ✔  Country: united states

Cases:      13  
Deaths:     0   

Recovered: 0

EDIT: compare also the following.

~ $ /~/git/covid19-cli/covid19-cli/dist/covid19-cli.sh --no-banner -c "new zealand"
 ✔  Country: new zealand

Cases:      null    
Deaths:     null    
Recovered:  null
~ $ /~/git/covid19-cli/covid19-cli/dist/covid19-cli.sh --no-banner -c nz
 ✔  Country: nz

Cases:      514 
Deaths:     1   
Recovered:  56
mbrehon commented 4 years ago

Between latest update to code and newer data sets, it seems the problem is now gone. I suspect the underlying data was changed, but can't be 100% certain it has or that it will remain.