9 |
our $q = 'AD=Croatia'; |
our $q = 'AD=Croatia'; |
10 |
my $range_size = 500; |
my $range_size = 500; |
11 |
my $overlap = 3; # between previous and this range |
my $overlap = 3; # between previous and this range |
12 |
|
my $skip_results = 1; |
13 |
|
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 |
|
|
21 |
$max_cites = 50; |
$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); |
28 |
use File::Path; |
use File::Path; |
36 |
our @ranges; |
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; |
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 |
|
|
212 |
|
|
213 |
search; |
search; |
214 |
years; |
years; |
215 |
get_results; |
get_results unless $skip_results; |
216 |
|
|
217 |
|
|
218 |
citations; |
citations; |