Monday, June 6, 2005

GetStore and Url Extraction

Things to Note:
perl program can take out URL out of xml files,
getstore() can store the file at the given url


@lines= split(/ /,$line);

@url="";
@filenames="";

foreach $item (@lines)
{
if($item =~ /^URL*/)
{
$i=index($item,"\"");
$j=rindex($item,"\"");
push(@url,substr($item,$i+1,$j-$i-1));
}
}

foreach $item (@url)
{
print "\n ";
$i=rindex($item,"/");
$filename= substr($item,$i+1,length($item)-2-$i);
push(@filenames, $filename);
if( getstore($item,"$dir/$numg-$filename") < 400)
{$numg++;}
}

No comments:

Post a Comment