
Thierry
Deleted
Mar 12, 2000, 4:26 AM
Post #1 of 5
(751 views)
|
|
:: Running script from Crontab
|
Can't Post
|
|
#print "Content-type: text/html\n\n"; use LWP::Simple; $doc = get "http://abcnews.go.com/";; @abc=split(/\n/,$doc); $rcd=0; $news=""; foreach $line (@abc){ $ft=substr "$line","",7; if($rcd==1){ if($line!~/font/){ if($ft ne '<!-- Po'){ $news="$news\n<tr><td valign=top><font size=-1>•</font></td><td valign=top>$line</td></tr>"; } }else{ if($line!~/<\/font>/){ $news="$news\n$line"; } } } if ($ft eq '<B>P O '){ $rcd=1; }elsif($ft eq '</font>'){ $rcd=0; } } $logpath = "../../catpol.txt"; open (LOG, ">$logpath"); print LOG "<table border=0 cellpadding=0 cellspacing=2>\n"; $news=~s/html\">/html\"><font size=-1>/gi; $news=~s/<\/a>/<\/a><\/font>/gi; print LOG "Politics<br>$news</td></tr>"; print LOG "<tr><td colspan=2></td></tr><tr><td colspan=2></center></p></td></tr>\n"; print LOG "</table>\n"; close(LOG); exit; If i run it from my browser it writes to that file. If i enter it as a job for crontab it does not print anything to that file ? Somebody may explain this to me, please. Thierry Zoller
|