--- casopisi/sciencedirect.pl 2002/10/24 16:34:08 1.1 +++ casopisi/sciencedirect.pl 2002/10/26 20:44:20 1.5 @@ -12,7 +12,7 @@ print MPS "M working...\n"; -my $base_url = 'http/www.sciencedirect.com'; +my $base_url = 'http://www.sciencedirect.com'; 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'; $debug++ if (lc($ARGV[0]) eq "-d"); @@ -33,15 +33,13 @@ #$ua->env_proxy(); #$ua->proxy(['http', 'ftp'], 'http://proxy.carnet.hr:8001/'); -#my $req = HTTP::Request->new(GET => $url); - -#my $res = $ua->request($req); -#if ($res->is_success) { - -if (1) { +my $req = HTTP::Request->new(GET => $url); +my $res = $ua->request($req); +if ($res->is_success) { my $tree = HTML::TreeBuilder->new; - $tree->parse_file("list.html"); # ! +# $tree->parse_file("list.html"); # ! + $tree->parse($res->content); foreach my $tr ($tree->look_down('_tag', 'tr')) { my $link; @@ -51,19 +49,23 @@ my $mps = ""; $bib .= "%tip Časopis\n"; - $bib .= "%tip online\n"; + $bib .= "%tip on-line\n"; # url $bib .= "%856 $base_url".$link->attr('href')."\n"; # naslov - $bib .= "%200 ".$link->as_text."\n"; + $bib .= "%200+ ".$link->as_text."\n"; $mps .= mps_expand(2,$link->as_text); - $mps .= "H ".$link->as_text."\n"; + # tip + $mps .= mps_expand(17,"on-line casopis"); + + $mps .= "H ".$link->as_text." <i>(on-line, ScrienceDirect)</i>\n"; + print R $bib."\n"; $mps .= "T document text/plain ".(tell(R) - $last_tell)." $dir/bib $last_tell ".tell(R)."\n"; $last_tell=tell(R); - print R $bib."\n"; + print R "\n"; $mps .= "E\n";