/[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 1335 by dpavlin, Sat Jun 5 15:49:59 2010 UTC revision 1336 by dpavlin, Tue Jun 29 18:32:27 2010 UTC
# Line 19  my $overlap    = 3; # between previous a Line 19  my $overlap    = 3; # between previous a
19    
20  my $results = 0;  my $results = 0;
21  my $citations = 0;  my $citations = 0;
22    my $cited_reference = 0; # html tables
23    my $citing_articles = 1; # as many files as cited articles
24    
25  my $cites_by_year = 0;  my $cites_by_year = 0;
26    
# Line 118  sub get_results { Line 120  sub get_results {
120                          last;                          last;
121                  }                  }
122    
123                    if ( $mech->content =~ m{Please wait while your request is processed} ) {
124                            warn "WARNING: processing request";
125                    }
126    
127    
128                  my $path = "/tmp/isi.$q.$from-$to";                  my $path = "/tmp/isi.$q.$from-$to";
129                  $path .= '.' . $desc if $desc;                  $path .= '.' . $desc if $desc;
# Line 235  if ( $citations ) { Line 241  if ( $citations ) {
241    
242  }  }
243    
244  if ( $q =~ m{CA=(.+)} ) {  if ( $q =~ m{CA=(.+)} && $cited_reference ) {
245    
246          my $CA = $1;          my $CA = $1;
247    
# Line 285  if ( $q =~ m{CA=(.+)} ) { Line 291  if ( $q =~ m{CA=(.+)} ) {
291    
292  }  }
293    
294    if ( $q =~ m{CA=(.+)} && $citing_articles ) {
295    
296            search;
297    
298            my $orig_q = $q;
299            my $nr = 0;
300    
301            foreach my $link ( $mech->find_all_links( url_regex => qr/CitingArticles.do/ ) ) {
302                    $nr++;
303                    warn "link $nr\n";
304                    $mech->get( $link->url );
305                    save_mech;
306                    $q = $orig_q . '.citing_article.' . $nr;
307                    get_results;
308                    $mech->back;
309                    save_mech;
310                    $mech->back;
311                    save_mech;
312            }
313    
314            $q = $orig_q;
315    }
316    
317  warn "OVER\n";  warn "OVER\n";

Legend:
Removed from v.1335  
changed lines
  Added in v.1336

  ViewVC Help
Powered by ViewVC 1.1.26