9 my $dump = @ARGV ? 1 : 0;
11 $q = 'TS=psychology AND AD=Croatia';
14 use Data::Dump qw/dump/;
16 our $mech = WWW::Mechanize->new(
24 my ( $mech, $path ) = @_;
26 $path ||= sprintf('/tmp/isi.%02d.%s', $step, $mech->{ct} =~ m{html}i ? 'html' : 'txt' );
27 $mech->save_content( $path );
28 warn "# [$step] $path ", -s $path, " ", $mech->ct;
29 $mech->dump_all if $dump;
33 $mech->get( 'http://isiknowledge.com/?DestApp=WOS' );
36 warn "# advanced serach";
37 $mech->follow_link( url_regex => qr/AdvancedSearch/ );
40 warn "# cookie_jar ", dump $mech->cookie_jar;
44 'value(input1)' => $q,
50 $mech->follow_link( url_regex => qr/summary/ );
59 my $to = $from + $range_size;
62 form_name => 'summary_output_form',
64 record_select_type => 'range',
69 qo_fields => 'fullrecord',
70 citedref => 'citedref',
72 save_options => 'plain_text',
81 if ( $mech->content =~ m{invalid API call} ) {
86 warn "# save_file $from - $to [$q]";
87 $mech->follow_link( url_regex => qr/save_file/ );
88 save_mech $mech => "/tmp/isi.$q.$from-$to.txt";
104 $mech->follow_link( url_regex => qr/search_mode=CitationReport/ );
107 $mech->follow_link( url_regex => qr/search_mode=TotalCitingArticles/ );
110 get_results $q . '.citing';