in reply to Re^3: parse html for specific things
in thread parse html for specific things

Laurent_R:

Yep, that's why my ~/bin directory contains json_prettify.pl:

#!/usr/bin/perl # # json_prettify.pl <FName> # # Prettifies FName and writes it to FName.out # use strict; use warnings; use JSON; my $json = JSON->new->allow_nonref; while (my $FName = shift) { my $oname = $FName . ".out"; my $txt; { local $/; open my $FH, '<', $FName or die "no! $!\n"; $txt = <$FH>; } my $data = $json->decode($txt); $txt = $json->pretty->encode($data); open my $OFH, '>', $oname or die "No no no! $!\n"; print $OFH $txt; }

I really need to make a thumb drive with my local ~/bin directory copied to it for when I visit other sites... ;^)

...roboticus

When your only tool is a hammer, all problems look like your thumb.

Replies are listed 'Best First'.
Re^5: parse html for specific things
by hippo (Archbishop) on Dec 18, 2017 at 17:18 UTC

      hippo:

      $ locate json_xs locate: warning: database ‘/var/locatedb’ is more than 8 days old (act +ual age is 12.3 days) C:/cygwin64\bin\json_xs C:/cygwin64\home\Roboticus\perl5\bin\cpanel_json_xs C:/cygwin64\home\Roboticus\perl5\man\man1\cpanel_json_xs.1 C:/cygwin64\usr\share\man\man1\json_xs.1.gz

      Nice! Now I don't have to bother. I hadn't noticed that I had a tool like that already installed. ;^)

      ...roboticus

      When your only tool is a hammer, all problems look like your thumb.