I always read Udayavani. I read Udayvani to understand the cultural and social face of Udupi. It is almost "pakka" that my permanent nest will be in Udupi. (extra to main topic)..
I read the paper online in the link: http://epaper.udayavani.com/. I had a problem here:After reading first page, I needed to wait sometime to download second page and so on. Most of the time I got irritate with this. In order to solve the problem, I used a small script which download the whole paper to the desktop directory.
Nb: There is nothing special in this code. Just(Junk) do it(JDI).
The perl code is here
#### New udayavani, with self date and directory of download.
###date 10/09/2011.
print "===================================\n
Welcome to Udayavani e-paper
\n===================================\n";
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time);
$dd=$mday;
$mm=$mon+1;
$yy=$year+1900;
print "Date:",$dd,"-",$mm,"-",$yy,"\n";
print "\n===================================\n";
#=====Date conversion
if ($dd<10){
@day[0]=0;
@day[1]=$dd;
}
else{
@sdd=split(//,$dd);
@day[0]=@sdd[0];
@day[1]=@sdd[1];
}
#=== @day;
#==========month conversion;
if ($mm<10){
@month[0]=0;
@month[1]=$mm;
}
else{
@smm=split(//,$mm);
@month[0]=@smm[0];
@month[1]=@smm[1];
}
#===@month;
#=================year conversion;
@syy=split(//,$yy);
shift(@syy);
shift(@syy);
$date=@day[0].@day[1].@month[0].@month[1].@syy[0].@syy[1];
#print "\n\n", $date,"\n\n"; converted value.
#========download converion for links
@letters=split(//,$date);
$date_part="2011-".@letters[2].@letters[3]."-".@letters[0].@letters[1];
$j=0;
for($i=1;$i<17;$i++){
if($i<10){
@letters[9]=0;
@letters[10]=$i;
}
else{
@letters[9]=1;
@letters[10]=$j;
$j=$j+1;
}
#print @letters,"\n";
$pageName=join("",@letters);
$pageName="Man".$pageName."M.pdf";
$link="http://epaper.udayavani.com/PDF/MANIPAL/".$date_part."\/".$pageName;
print $link,"\n";
#print $pageName;
system("wget --directory-prefix=/home/venkat/Desktop/Udayavani $link");
}
====end of the code =====
No comments:
Post a Comment