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); |
my $req = HTTP::Request->new(GET => $url); |
|
|
|
|
#my $res = $ua->request($req); |
|
|
#if ($res->is_success) { |
|
|
|
|
|
if (1) { |
|
37 |
|
|
38 |
|
my $res = $ua->request($req); |
39 |
|
if ($res->is_success) { |
40 |
my $tree = HTML::TreeBuilder->new; |
my $tree = HTML::TreeBuilder->new; |
41 |
$tree->parse_file("list.html"); # ! |
# $tree->parse_file("list.html"); # ! |
42 |
|
$tree->parse($res->content); |
43 |
|
|
44 |
foreach my $tr ($tree->look_down('_tag', 'tr')) { |
foreach my $tr ($tree->look_down('_tag', 'tr')) { |
45 |
my $link; |
my $link; |
49 |
my $mps = ""; |
my $mps = ""; |
50 |
|
|
51 |
$bib .= "%tip Časopis\n"; |
$bib .= "%tip Časopis\n"; |
52 |
$bib .= "%tip online\n"; |
$bib .= "%tip on-line\n"; |
53 |
# url |
# url |
54 |
$bib .= "%856 $base_url".$link->attr('href')."\n"; |
$bib .= "%856 $base_url".$link->attr('href')."\n"; |
55 |
# naslov |
# naslov |
56 |
$bib .= "%200 ".$link->as_text."\n"; |
$bib .= "%200+ ".$link->as_text."\n"; |
57 |
$mps .= mps_expand(2,$link->as_text); |
$mps .= mps_expand(2,$link->as_text); |
58 |
|
|
59 |
$mps .= "H ".$link->as_text."\n"; |
# tip |
60 |
|
$mps .= mps_expand(17,"on-line"); |
61 |
|
|
62 |
|
$mps .= "H ".$link->as_text." <i>(on-line, ScrienceDirect)</i>\n"; |
63 |
|
|
64 |
|
print R $bib."\n"; |
65 |
$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"; |
66 |
$last_tell=tell(R); |
$last_tell=tell(R); |
67 |
|
|
68 |
print R $bib."\n"; |
print R "\n"; |
69 |
|
|
70 |
$mps .= "E\n"; |
$mps .= "E\n"; |
71 |
|
|