garrylachman / covid19-cli Goto Github PK
View Code? Open in Web Editor NEWCorona Virus (Covid 19) BASH Tracking CLI
License: MIT License
Corona Virus (Covid 19) BASH Tracking CLI
License: MIT License
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
Is your feature request related to a problem? Please describe.
I'm always frustrated when interpreting the output is hard because the output lacks punctuation.
Describe the solution you'd like
Add punctuation to the output. Thus, 10000
should be 10,000
or - depending on the locale - 10.000
. I imagine that BASH should make it fairly easy to make the change.
Describe alternatives you've considered
I can think of no alternative remedy for the problem.
The shellcheck program (available for editors and also online at https://www.shellcheck.net/) is unhappy with various parts of the main script (viz., covid19-cli.sh). Many of those problems have to do with 'globbing' and I wonder whether here we have the source of #15.
Desktop:
Software versions
I believe the instructions should be as follows. I embolden the step you seem to be missing.
git clone https://github.com/garrylachman/covid19-cli.git
cd covid19-cli
make
Either worldofmeters https://www.worldometers.info/coronavirus/
or John Hopkins university map https://coronavirus.jhu.edu/map.html
(Both allow getting data per country)
Describe the bug
All stats are zero when searching for a country
To Reproduce
Steps to reproduce the behavior:
1.'./covid19-cli.sh -c Netherlands'
2. See error
Expected behavior
It probably should show other numbers than 0
Screenshots
./covid19-cli.sh -c Netherlands
Desktop:
Software versions
if I run it with bash it's is working now but if I run it as an executable I get a script error.
I'm on Ubuntu 18.04.4
changing first line to "#!/usr/bin/env bash" did fix the issue
$ ./covid19-cli.sh
./covid19-cli.sh: 16: ./covid19-cli.sh: [[: not found
./covid19-cli.sh: 19: ./covid19-cli.sh: Syntax error: "(" unexpected
$ bash covid19-cli.sh
✔ Global Statistics
Cases: 255733, Deaths: 10495, Recovered: 89918
$ bash covid19-cli.sh --country=USA
✔ Country: USA
Cases: 14373, Deaths: 218, Recovered: 125
Hello!
It would be nice to explain, in the help text, how the user should enter the country (two-letter abbreviation? full name? how would I know exactly how to enter some country?)
Also, it would be nice, perhaps, to report the full country name in the output:
./covid19-cli.sh -c aa
...
✔ Country: aa
Cases: 1, Deaths: 0, Recovered: 0
Hm, but what is the user is not sure if aa
is really the country she wanted to select?
lmao.ninja v1 api endpoints have been deprecated. use v2
$ bash covid19-cli.sh --country USA
✔ Global Statistics
Cases: 252773, Deaths: 10405, Recovered: 89060
Describe the bug
covid19-cli.sh: line 9: warning: setlocale: LC_NUMERIC: cannot change locale (en_US): No such file or directory
✔ Country: united states
jq: error (at <stdin>:1): Cannot iterate over null (null)
jq: error (at <stdin>:1): Cannot iterate over null (null)
[my path]/covid19-cli.sh: line 411: printf: null: invalid number
Cases: 0
[my path]/covid19-cli/dist/covid19-cli.sh: line 412: printf: null: invalid number
Deaths: 0
[my path]/covid19-cli/dist/covid19-cli.sh: line 413: printf: null: invalid number
Recovered: 0
To Reproduce
Run the program with seeminly any option.
Expected behavior
A clear and concise description of what you expected to happen.
Desktop:
Software versions
GNU bash, version 4.4.20(1)-release (x86_64-pc-linux-gnu)
Latest git version of covid19-cli
Additional context
I think it is a problem with the data source - for, a similar program that I have has a similar problem - but your program should handle the problem more gracefully.
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.