12 |
|
|
13 |
print MPS "M working...\n"; |
print MPS "M working...\n"; |
14 |
|
|
15 |
my $base_url = 'http/www.sciencedirect.com'; |
my $base_url = 'http://www.sciencedirect.com'; |
16 |
my $url = $base_url . '/science?_ob=JournalListURL&_type=subscribed&_stype=title&subjColl=all&_auth=y&_update=y&_frameSeg=M&_title=all&_acct=C000050661&_version=1&_urlVersion=0&_userid=1034703&md5=6d4b6e263318a1d7d2a3b523d861f920'; |
my $url = $base_url . '/science?_ob=JournalListURL&_type=subscribed&_stype=title&subjColl=all&_auth=y&_update=y&_frameSeg=M&_title=all&_acct=C000050661&_version=1&_urlVersion=0&_userid=1034703&md5=6d4b6e263318a1d7d2a3b523d861f920'; |
17 |
|
|
18 |
$debug++ if (lc($ARGV[0]) eq "-d"); |
$debug++ if (lc($ARGV[0]) eq "-d"); |
33 |
#$ua->env_proxy(); |
#$ua->env_proxy(); |
34 |
#$ua->proxy(['http', 'ftp'], 'http://proxy.carnet.hr:8001/'); |
#$ua->proxy(['http', 'ftp'], 'http://proxy.carnet.hr:8001/'); |
35 |
|
|
36 |
#my $req = HTTP::Request->new(GET => $url); |
print "getting '$url'...\n"; |
37 |
|
my $req = HTTP::Request->new(GET => $url); |
|
#my $res = $ua->request($req); |
|
|
#if ($res->is_success) { |
|
|
|
|
|
if (1) { |
|
38 |
|
|
39 |
|
my $res = $ua->request($req); |
40 |
|
if ($res->is_success) { |
41 |
|
print "parsing html...\n"; |
42 |
my $tree = HTML::TreeBuilder->new; |
my $tree = HTML::TreeBuilder->new; |
43 |
$tree->parse_file("list.html"); # ! |
# $tree->parse_file("list.html"); # ! |
44 |
|
$tree->parse($res->content); |
45 |
|
|
46 |
foreach my $tr ($tree->look_down('_tag', 'tr')) { |
foreach my $tr ($tree->look_down('_tag', 'tr')) { |
47 |
my $link; |
my $link; |
51 |
my $mps = ""; |
my $mps = ""; |
52 |
|
|
53 |
$bib .= "%tip Časopis\n"; |
$bib .= "%tip Časopis\n"; |
54 |
$bib .= "%tip online\n"; |
$bib .= "%tip on-line\n"; |
55 |
# url |
# url |
56 |
$bib .= "%856 $base_url".$link->attr('href')."\n"; |
$bib .= "%856 $base_url".$link->attr('href')."\n"; |
57 |
# naslov |
# naslov |
58 |
$bib .= "%200 ".$link->as_text."\n"; |
$bib .= "%200+ ".$link->as_text."\n"; |
59 |
$mps .= mps_expand(2,$link->as_text); |
$mps .= mps_expand(2,$link->as_text); |
60 |
|
|
61 |
$mps .= "H ".$link->as_text."\n"; |
# tip |
62 |
|
$mps .= mps_expand(17,"on-line casopis"); |
63 |
|
|
64 |
|
$mps .= "H ".$link->as_text." <i>(on-line, ScrienceDirect)</i>\n"; |
65 |
|
|
66 |
|
print R $bib."\n"; |
67 |
$mps .= "T document text/plain ".(tell(R) - $last_tell)." $dir/bib $last_tell ".tell(R)."\n"; |
$mps .= "T document text/plain ".(tell(R) - $last_tell)." $dir/bib $last_tell ".tell(R)."\n"; |
68 |
$last_tell=tell(R); |
$last_tell=tell(R); |
69 |
|
|
70 |
print R $bib."\n"; |
print R "\n"; |
71 |
|
|
72 |
$mps .= "E\n"; |
$mps .= "E\n"; |
73 |
|
|