/[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 1331 by dpavlin, Sun Apr 18 10:56:01 2010 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    $q = join(' ', @ARGV) if @ARGV;
25    
26  use WWW::Mechanize;  use WWW::Mechanize;
27  use Data::Dump qw(dump);  use Data::Dump qw(dump);
# Line 25  our $mech = WWW::Mechanize->new( Line 33  our $mech = WWW::Mechanize->new(
33  );  );
34    
35  our $step = 0;  our $step = 0;
36    our @ranges;
37    
38  my $dir = '/tmp/isi/';  my $dir = '/tmp/isi/';
39  rmtree $dir if -e $dir;  #rmtree $dir if -e $dir;
40  mkdir $dir;  mkdir $dir unless -d $dir;
41    
42  sub save_mech {  sub save_mech {
43          my $path = shift;          my $path = shift;
# Line 164  sub years { Line 173  sub years {
173    
174          my @y = sort keys %$years;          my @y = sort keys %$years;
175    
176            @ranges = ();
177    
178            if ( $cites_by_year ) {
179                    push @ranges, [ $_ ] foreach @y;
180                    warn "# cites_by_year ranges ", dump @ranges;
181                    return;
182            }
183    
184          my $y = shift @y;          my $y = shift @y;
185          my $size = $years->{$y};          my $size = $years->{$y};
186    
         @ranges = ();  
187          my $cites_range;          my $cites_range;
188          $cites_range = [$y] if $y;          $cites_range = [$y] if $y;
189    
# Line 196  sub years { Line 212  sub years {
212    
213  search;  search;
214  years;  years;
215  get_results;  get_results unless $skip_results;
216    
217    
218  citations;  citations;
# Line 206  do { Line 222  do {
222          if ( @ranges ) {          if ( @ranges ) {
223                  $part .= $ranges[0]->[0] . '.';                  $part .= $ranges[0]->[0] . '.';
224                  search;                  search;
225                    citations;
226          }          }
227          $part .= 'citing';          $part .= 'citing';
228          get_results $part;          get_results $part;

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

  ViewVC Help
Powered by ViewVC 1.1.26