about summary refs log tree commit diff stats
Commit message (Collapse)AuthorAgeFilesLines
* Fix rows option behaviourAndinus2020-06-141-8/+8
| | | | | | | | | | | | The behaviour was broken because previously it wouldn't have printed as many rows as user had entered because of other options. For example, say if user ran `ara --rows 2 --hide india`, previously this would've printed only 1 row because "India" is always the first row & the foreach loop would've looped only two times so $rows_to_print was more like number of rows to iterate over. Now it does what it says, it prints that many number of rows.
* Initialize %hide earlierAndinus2020-06-141-2/+1
|
* Shorten "State Unassigned", check for statecode if length > 16Andinus2020-06-131-2/+10
|
* Add option to hide statesAndinus2020-06-131-7/+22
| | | | I could also extend this to hiding columns.
* Add option to hide 'Total' rowAndinus2020-06-131-2/+9
|
* Add more colors to outputAndinus2020-06-131-4/+14
| | | | This also tunes the colors a bit.
* Add Term::ANSIColor to cpanfileAndinus2020-06-131-0/+1
|
* Remove colors from Last Updated columnAndinus2020-06-131-8/+5
| | | | I decided it looks better without colors.
* Add colors to terminal outputAndinus2020-06-131-11/+47
| | | | | | | | | | | Colors in deltas will be changed as they increase or decrease. Maybe I should define colors with some magic math, I'll think about it. For now this is good enough. Currently it's 19:00 here & states haven't yet updated the records so I don't see any colors, I'll see them in action at night when they're updated. I should remove colors from Last Updated column maybe because it's not that helpful, almost all states update daily.
* Fix CRITICAL error: unveil was overriden by custom subAndinus2020-06-111-5/+8
| | | | | | | | | | sub declarations are decided on compile time irrespective of surrounding if blocks so unveil sub was getting overriden by { return 1; } everytime which means that basically unveil wasn't running at all. And this is why I should've written tests or maybe even add a debug flag that would warn each time custom unveil is called.
* Add note for OpenBSD users in READMEAndinus2020-06-111-2/+2
|
* Use OpenBSD::Unveil only on OpenBSDAndinus2020-06-111-1/+7
| | | | | | | | This will fail if user doesn't has the path in @INC which might be possible on custom Perl install. I'll add a note about this in README. This is good for non-OpenBSD users as now the program will run on their system without any changes.
* Add "nodelta" flagAndinus2020-06-111-7/+10
| | | | "nodelta" flag will not print any delta changes.
* Save $file in cache directoryAndinus2020-06-101-5/+7
| | | | This includes unix specific code & should be mentioned in README.
* Use sprintf to append delta valuesAndinus2020-06-101-8/+3
| | | | | This does the same thing as the if block, I also applied it to all three values because "why not?". sprintf handles this cleanly.
* Use ->ctime instead of accessing the array directlyAndinus2020-06-101-1/+1
|
* Use ctime instead of mtime to compareAndinus2020-06-101-3/+3
| | | | | | | | HTTP::Tiny sets mtime to "Last Modified" time set by the server. ctime is set as the time when that file gets created on disk so we use that to compare now, actually this should've been used from the start but File::Fetch didn't set mtime differently (?) so mtime worked till we used File::Fetch.
* Better unveil listAndinus2020-06-101-3/+4
| | | | While not perfect this is a lot better than the old list.
* Switch to HTTP::Tiny, add to cpanfileAndinus2020-06-102-6/+14
| | | | HTTP::Tiny has more options.
* Don't add '+' to deltaconfirmed if it's a negative numberAndinus2020-06-081-1/+6
| | | | | "State Unassigned" had deltaconfirmed of -773 today which showed up as "+-773".
* Restyle codeAndinus2020-06-071-46/+47
| | | | Looks like many like this style, looks good to me too.
* Use foreach instead of eachAndinus2020-06-061-3/+4
|
* Use if block instead of '?'Andinus2020-06-061-2/+4
|
* Remove unused feature 'say'Andinus2020-06-061-1/+0
|
* Add demo video, remove example outputAndinus2020-06-061-46/+1
| | | | | | | Example output will change all the time & I also added new things like State Notes so better just remove it instead of creating huge diffs for every new function. Instead I added a demo video which users can watch.
* Change Notes column width to 74Andinus2020-06-061-1/+1
|
* Add help flagAndinus2020-06-061-0/+12
|
* Add Getopt::Long to cpanfileAndinus2020-06-061-0/+1
|
* Add $rows argument, change behaviourAndinus2020-06-061-73/+81
| | | | | | | | | | | | | User can now specify the number of rows to print. It'll print all the rows if --notes is passed or if $rows evaluates to false or if the user passed value greater than the length of Array. It'll now warn the user if file doesn't exist locally & user has passed --local, also instead of just dying it fetches the file from the web instead. $covid_19_data not doesn't get printed if --notes is passed. We assume that the user either wants to see notes or $covid_19_data.
* use Getopt::Long to GetOptions from cliAndinus2020-06-061-9/+31
|
* Remove Text::Table::Tiny from cpanfileAndinus2020-06-061-1/+0
|
* Switch to Text::ASCIITable for $covid_19_dataAndinus2020-06-061-8/+18
| | | | Instead of using 2 modules we switch everything to Text:ASCIITable.
* Add Time::Moment, remove DateTime from cpanfileAndinus2020-06-061-1/+1
|
* Remove DateTime, use Time::Moment insteadAndinus2020-06-061-9/+11
| | | | | | | After removing all DateTime code it took ~0.98s to run, before that it was ~1.2s. And after removing 'use DateTime' it now takes ~0.30s to run, all of this is without File::Fetch part, it loaded the data from disk instead of fetching.
* Use == to compare numbers instead of eqAndinus2020-06-061-1/+1
| | | | | No need to convert it to string for comparision, we instead use == to compare numbers.
* Use Time::Moment for $file_mtime instead of DateTimeAndinus2020-06-061-5/+3
| | | | | | | | | First step to replacing DateTime with Time::Moment, DateTime is very huge, no need to load that large module for simple tasks, it'll also make the program run faster. This comparison happens in utc time instead of converting it to other time zone which was meaningless anyways.
* use File::Fetch only when requiredAndinus2020-06-061-1/+2
| | | | | 'use File::Fetch' gets processed at compile time so we use 'require File::Fetch' instead.
* Add Text::ASCIITable to cpanfileAndinus2020-06-061-0/+1
|
* Use Text::ASCIITable for State NotesAndinus2020-06-051-7/+7
| | | | | | Text::Table::Tiny wasn't good for state notes because they were long & had characters like '\n'. Text::ASCIITable has nice options to work with these.
* Print state notes along with covid-19 dataAndinus2020-06-051-4/+16
|
* Merge if statements into a single blockAndinus2020-06-051-9/+7
| | | | | Instead of checking if( $update_info eq "Today" ) three times, we check it only once.
* Fetch latest data only if local data is old or doesn't existAndinus2020-06-051-6/+24
| | | | | This will fetch the latest data only if the local data is older than 8 minutes or the file doesn't exist.
* Fix deltarecovered & deltadeathsAndinus2020-06-051-2/+2
| | | | They were swapped for some reason.
* Show delta only if it was updated TodayAndinus2020-06-051-3/+16
|
* Add $statewise as intermediateAndinus2020-06-031-7/+10
|
* Remove @statewise & clean up codeAndinus2020-06-031-10/+7
| | | | | @statewise thing did some stuff that I didn't understand, instead of that we directly take data from $json_data.
* Add cpanfileAndinus2020-05-291-0/+5
|
* Remove use Data::DumperAndinus2020-05-291-1/+0
|
* Use statecode if state name is too longAndinus2020-05-291-4/+8
|
* Change timezone to 'Asia/Kolkata'Andinus2020-05-291-1/+1
|