about summary refs log tree commit diff stats
Commit message (Collapse)AuthorAgeFilesLines
* Fix date parsing HEAD masterAndinus2021-04-021-5/+18
| | | | | | | | Some dates are in d/m/YYYY format, previously they used to be in dd/mm/YYYY or maybe they were always in this format & I only noticed it now. I should not parse dates this way & use some module.
* Re-generate READMEAndinus2021-04-021-42/+42
|
* Update year in LICENSEAndinus2021-04-021-1/+1
|
* Add note on showdelta about autohideAndinus2020-08-031-0/+2
|
* Fix help optionAndinus2020-08-031-1/+1
| | | | | --help was broken because it was being over-ridden by --h, now both should work.
* Document autohide functionality in READMEAndinus2020-08-031-8/+25
|
* Add Term::Size to cpanfileAndinus2020-08-031-0/+1
|
* Add auto hide functionalityAndinus2020-08-031-1/+14
| | | | | This will automatically hide columns if the term size is small. It's just some dumb if conditions, no magic.
* Change color intensity, remove colors from state columnAndinus2020-07-291-13/+10
| | | | | | | The numbers are increasing & it made sense to increase values for bolder colors. Also, I changed from ON_COLOR to BOLD because the latter looks better. State colors were removed because it wasn't much helpful.
* Add plain-text README fileAndinus2020-07-123-219/+297
| | | | | | cgit doesn't render Org files. I think I'll add `*.org' to `.gitignore' & export to plain text for README. My website will still have the html version.
* Move state notes table generator to a moduleAndinus2020-06-182-15/+72
|
* Use %show instead of @to_showAndinus2020-06-181-1/+1
| | | | %show should be used everywhere & @to_show only to create %show.
* Remove HTTP::Tiny related code, change $response to $statusAndinus2020-06-161-6/+3
|
* Add showdelta optionAndinus2020-06-161-13/+15
|
* Describe showdelta in README, add changes about help optionAndinus2020-06-161-0/+6
| | | | | help message was getting too cluttered so I removed nototal from there.
* Fix cpanfile, require Net::SSLeayAndinus2020-06-151-3/+2
|
* Remove $SIG{__DIE__}Andinus2020-06-151-1/+0
| | | | | <haarg> notandinus: __DIE__ handlers get called even for errors that are trapped by an eval
* Override warn & die sub to add colorsAndinus2020-06-151-14/+15
|
* Update README with documentationAndinus2020-06-151-1/+190
| | | | Some basic documentation, for more details look at logs.
* Move HelpMessage sub near GetOptionsAndinus2020-06-151-18/+18
|
* Add option to remove number formatting with wordsAndinus2020-06-141-5/+7
|
* Format numbers with Number::Format::SouthAsian, add to cpanfileAndinus2020-06-142-16/+27
|
* Print error when no rows to printAndinus2020-06-141-0/+3
|
* Change warning color to yellow from redAndinus2020-06-141-4/+5
|
* Add option to show only passed statesAndinus2020-06-141-8/+22
| | | | | | | Now user can specify states in "show" option & only those states will be printed, "hide" option is ignored when "show" is passed. Note: "hide" is ignored only for states & not for columns.
* Warn on invalid options instead of dyingAndinus2020-06-141-4/+8
|
* Add latest demo video to READMEAndinus2020-06-141-1/+4
|
* Make text on output readableAndinus2020-06-141-4/+4
|
* Use foreach instead of each, remove iterator reset lineAndinus2020-06-141-3/+2
| | | | | | Initial commit message was "Remove useless line", that line would feel bad so I changed it. I think it got left out when I moved from each to foreach.
* Add HTTP::Simple to cpanfile, remove HTTP::TinyAndinus2020-06-141-1/+1
|
* Warn about not hiding notes column only if notes option was passedAndinus2020-06-141-1/+2
| | | | | Warning about not hiding notes column will only print if user passed --notes.
* Alias updated to last updatedAndinus2020-06-141-0/+5
|
* Document a line, ignoring a warningAndinus2020-06-141-0/+1
| | | | | | | | | | | | | | | | | | | | It would've printed something like: Name "HTTP::Simple::UA" used only once: possible typo at /home/andinus/projects/scripts/ara line 121. Error in tempfile() using template https:/api.covid19india.org/XXXXXXXXXX: Parent directory (https:/api.covid19india.org/) does not exist at /home/andinus/perl5/lib/perl5/HTTP/Simple.pm line 69. Grinnz on #perl (freenode.net) said: probably because HTTP::Simple isn't loaded until runtime, that warning is pretty stupid it's a workaround for before they had proper lexical variables to work with that can detect typoes correctly
* Enforce local optionAndinus2020-06-141-6/+9
| | | | | | | Till now the local option was actually useless, this enforces it. The program will only not respect local option if the file doesn't exist. Otherwise in all cases it shall respect the option.
* Fix file fetching logic, use mtime, switch to HTTP::SimpleAndinus2020-06-141-8/+9
| | | | | | | | | | | | | | | The issue with ctime is that it doesn't change & stays the same as when the file was actually created, this means the code was running the if block basically everytime after 8 minutes of file creation. And I couldn't use mtime because HTTP::Tiny's mirror method stores mtime as 'Last Modified' header. This switch to HTTP::Simple will download the file everytime which means the mtime changes & we can make the program not look for file every time. However this also means that we are downloading the whole file everytime instead of only when it changes. Meh... It's okay because the alternative is to write a complicated logic.
* Add ability to hide columnsAndinus2020-06-141-23/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Only hiding "State" & "Notes" column is forbidden & will print a warning for the user. I should also optimize other parts, like it still creates $deaths & does all related calulations even if we hide that column. And for @columns part, #perl (freenode.net) suggested some other methods too but later we found out they were all broken (logical error), the solutions were nice though & so I'm recording them here. I could've created a %fields hash like this: my %fields = ( State => 1 ... ); And then I would delete the things that user wants to hide: delete $fields{s/\b(\w)/\U$1/gr} for keys %hide; Either like that or like this: delete @fields{ map ucfirst, keys %hide }; Then just used keys %fields in setCols(). Issue with the first delete method is that it's complicated & I didn't understand it so I wasn't going to use it anyways. Issue with the second delete method is that it wouldn't have worked with "Last Updated" field because there is a space in between, ucfirst function would've only capitalized 'L' of "Last". Even if I understood the first method or somehow fix the second method all this still wont work because keys %fields would get me columns in random order which isn't what I want.
* 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.