6 use IO::Socket::SSL qw();
11 my ( $class, $database ) = @_;
16 mech => WWW::Mechanize->new(
18 SSL_verify_mode => IO::Socket::SSL::SSL_VERIFY_NONE,
19 verify_hostname => 0, # this key is likely going to be removed in future LWP >6.04
22 database => $database,
28 sub mech { $_[0]->{mech} }
31 my ( $self, $id, $marc ) = @_;
33 my $database = $self->{database};
34 mkdir 'marc' unless -e 'marc';
35 mkdir "marc/$database" unless -e "marc/$database";
37 my $path = "marc/$database/$id";
39 open(my $out, '>:utf8', $path) || die "$path: $!";
43 warn "# created $path ", -s $path, " bytes";
51 my $path = "/tmp/$dump_nr.html";
52 open(my $html, '>', $path);
53 print $html $self->{mech}->content;
55 warn "# save_content $path ", -s $path, " bytes";