in reply to Re^3: parse html for specific things
in thread parse html for specific things
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 | |
by roboticus (Chancellor) on Dec 18, 2017 at 22:10 UTC |