make dump of html details optional and $range_size configurable
authorDobrica Pavlinusic <dpavlin@rot13.org>
Fri, 18 Sep 2009 17:46:04 +0000 (17:46 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Fri, 18 Sep 2009 17:46:04 +0000 (17:46 +0000)
git-svn-id: svn+ssh://mjesec/home/dpavlin/svn/webpac2/trunk@1282 07558da8-63fa-0310-ba24-9fe276d99e06

bin/isi-download-results.pl

index 2cc88b6..7141e6d 100755 (executable)
@@ -4,6 +4,12 @@ use warnings;
 use strict;
 
 my $q = 'TS=psychology AND AD=Croatia';
+my $range_size = 50;
+
+my $dump = @ARGV ? 1 : 0;
+
+$q = 'AD=Croatia';
+$range_size = 500;
 
 use WWW::Mechanize;
 use Data::Dump qw/dump/;
@@ -21,7 +27,7 @@ sub save_mech {
        $path ||= sprintf('/tmp/isi.%02d.%s', $step, $mech->{ct} =~ m{html}i ? 'html' : 'txt' );
        $mech->save_content( $path );
        warn "# [$step] $path ", -s $path, " ", $mech->ct;
-       $mech->dump_all;
+       $mech->dump_all if $dump;
 }
 
 warn "# get session";
@@ -46,7 +52,6 @@ $mech->follow_link( url_regex => qr/summary/ );
 save_mech $mech;
 
 my $from = 1;
-my $range_size = 50;
 
 while ( $from ) {