Skip to content

Instantly share code, notes, and snippets.

@paveljurca
Last active November 23, 2017 07:11
Show Gist options
  • Save paveljurca/c17ca1c6fabafd99d4a0 to your computer and use it in GitHub Desktop.
Save paveljurca/c17ca1c6fabafd99d4a0 to your computer and use it in GitHub Desktop.
use strict;
use warnings;
use LWP::UserAgent;
use open qw/:std :utf8/;
use autodie;
use IPC::Open2;
# knihovna VC
#my $session = int(rand(1000000000)+0.5);
use constant API
=> 'https://library.vse.cz/F/1T9XVIRHI4E8QV7ESLL6KP7KH91TL313JSXQEJ55LC377EKM89-23509?func=find-e&amp=&amp=&con%5Flng=cze&RN=541653119&pds_handle=GUEST&request='
;
my $req = HTTP::Request->new(
GET => API . 'f219683', [
User_Agent => '',
]
);
my $res = LWP::UserAgent->new->request($req);
die q(can't connect) if $res->is_error;
open my $W3M, '|w3m -T text/html -dump -cols 300';
print $W3M $res->decoded_content;
#open2(\*DUMP, \*W3M, "w3m");
#my $dump = do {
# $/ = undef;
#
# $res->decoded_content;
#};
#print $dump;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment