// (c)2011 Hintlink Technology, Paul Evans. WWV RSS feed generator.
//
/*
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
*/
// Change these configuration strings as required
// When called from cron, complete paths make be required
$title="W4/VP9KF WWV RSS Feed";
$link="http://w4.vp9kf.com";
$description="W4/VP9KF WWV Feed";
$copyright="Copyright 2008, Hintlink Technology";
$image="http://w4.vp9kf.com/ar_logosmall.gif";
$datafile="/usr/home/g4bki/usr/local/etc/httpd/htdocs/w4vp9kf/sun/latest_wwv.txt";
$xmlfile="/usr/home/g4bki/usr/local/etc/httpd/htdocs/w4vp9kf/sun/wwv_rss2.xml";
$rss = ""."\n";
$rss .= ''."\n";
$rss .= ''."\n";
$rss .= ''."\n";
$rss .= ''.$title.''."\n";
$rss .= ''.$link.''."\n";
$rss .= ''.$description.''."\n";
$rss .= ''.'en-us'.''."\n";
$rss .= ''.$copyright.''."\n";
//new lastBuildDate code
$dandt=date("D, d M Y H:i:s").' GMT';
$rss .= ''.$dandt.''."\n";
// end of header
$rss .= ''."\n";
$rss .= ''.$title.''."\n";
$rss .= ''.$image.''."\n";
$rss .= ''.$link.''."\n";
$rss .= '30'."\n";
$rss .= '10'."\n";
$rss .= ''.$description.''."\n";
$rss .= ''."\n";
// end of image
// start item loop
$memlines=file($datafile);
$newfile=($xmlfile);
$outfile=fopen($newfile,"w+");
foreach($memlines as $mline)
{
$rss .= ''."\n";
$rss .= ''.$mline.''."\n";
$rss .= ''.$link.''."\n";
$rss .= ''.$mline.''."\n";
$rss .= ''."\n";
}
$rss .= ''."\n";
$rss .= ''."\n";
$rss .= ''."\n";
fputs($outfile,$rss);
fclose($outfile);
echo $rss;
?>