Quote: the pacific ocean is really big, you just won't believe how vastly hugely mind boggling big it is. I mean you may think its a long way down the street to the chemist but that's just peanuts compared with the Pacific. - Tom's misquote of the Hitch Hiker's Guide to the Galaxy
Oceanhippie.net - Tom's Blog
Here you will find stuff on Tom's travels, with empasis on video, pictures and PC Desktop wallpapers.
I'm a sailor and WiFi specialist, so you'll find technical stuff here too.
Display Inshore forecast from BOM for digital signage or website
the Following code will go grab the xml for the Darwin Harbour inshore forecast from BOM and save it to disk as a htm and txt file.
The idea is run it once as a cron job - then just call the txt or htm file to display it for hte rest of the day
getElementsByTagName('forecast') as $e ) {
$e = $e->parentNode; // this should be the element
foreach( $e->getElementsByTagName('forecast-period') as $l ) {
if($l->getAttribute('index')=='0') {
$date = date( "l jS F ", strtotime($l->getAttribute('start-time-local')));
$curTxt= "Forcast for Darwin Harbour for $date \n \n";
$curHtm= "
\n";
}
}
}
}
//Dispaly as text
echo $curTxt;
file_put_contents('../../imagecache/forecast.txt', $curTxt); //save file for rest of the day.
//separator
echo "############################################################################## \n";
//display as html
$curHtm=$curHtm."
";
echo $curHtm;
file_put_contents('../../imagecache/forecast.htm', $curHtm); //save file for the resrt of hte day.
?>