/[webpac2]/trunk/bin/isi-download-results.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/bin/isi-download-results.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1292 by dpavlin, Sat Sep 19 20:35:43 2009 UTC revision 1300 by dpavlin, Sat Sep 19 23:49:04 2009 UTC
# Line 8  use strict; Line 8  use strict;
8    
9  our $q = 'AD=Croatia';  our $q = 'AD=Croatia';
10  my $range_size = 500;  my $range_size = 500;
11  my $overlap    = 10; # between previous and this range  my $overlap    = 3; # between previous and this range
12    my $skip_results = 1;
13  $q = 'TS=psychology AND AD=Croatia' if @ARGV; # FIXME debug  my $cites_by_year = 1;
14    
15  my $max_cites = 5000; # ISI limit to get cites  my $max_cites = 5000; # ISI limit to get cites
16  our @ranges;  
17    if ( 0 ) {
18            $q = 'TS=psychology AND AD=Croatia';
19            $range_size = 50;
20            $overlap    = 0;
21            $max_cites  = 50;
22    }
23    
24  use WWW::Mechanize;  use WWW::Mechanize;
25  use Data::Dump qw(dump);  use Data::Dump qw(dump);
# Line 25  our $mech = WWW::Mechanize->new( Line 31  our $mech = WWW::Mechanize->new(
31  );  );
32    
33  our $step = 0;  our $step = 0;
34    our @ranges;
35    
36  my $dir = '/tmp/isi/';  my $dir = '/tmp/isi/';
37  rmtree $dir if -e $dir;  rmtree $dir if -e $dir;
# Line 164  sub years { Line 171  sub years {
171    
172          my @y = sort keys %$years;          my @y = sort keys %$years;
173    
174            @ranges = ();
175    
176            if ( $cites_by_year ) {
177                    push @ranges, [ $_ ] foreach @y;
178                    warn "# cites_by_year ranges ", dump @ranges;
179                    return;
180            }
181    
182          my $y = shift @y;          my $y = shift @y;
183          my $size = $years->{$y};          my $size = $years->{$y};
184    
         @ranges = ();  
185          my $cites_range;          my $cites_range;
186          $cites_range = [$y] if $y;          $cites_range = [$y] if $y;
187    
# Line 196  sub years { Line 210  sub years {
210    
211  search;  search;
212  years;  years;
213  get_results;  get_results unless $skip_results;
214    
215    
216  citations;  citations;
# Line 206  do { Line 220  do {
220          if ( @ranges ) {          if ( @ranges ) {
221                  $part .= $ranges[0]->[0] . '.';                  $part .= $ranges[0]->[0] . '.';
222                  search;                  search;
223                    citations;
224          }          }
225          $part .= 'citing';          $part .= 'citing';
226          get_results $part;          get_results $part;

Legend:
Removed from v.1292  
changed lines
  Added in v.1300

  ViewVC Help
Powered by ViewVC 1.1.26