Hi All,
I’ve been playing with some universal code to embed any of the Bureau of Meteorology rain radars into a web page… The initial cut of code allows you to display any of the radars on your webpage, either defaulting to a particular radar or letting the user select which one they want to look at…
The 1st cut of public code can be downloaded from http://hamlynheightsweather.com/downloads/RainRadar/RainRadar-v4.zip
Or if you want to see it in action, check it out on a mates website at Geelong Weather - Geelong Rain Radar
You should be able to dump this php script straight onto your box and it will work straight away… The sample webpage is test.php which calls the RainRadar.php script… Some basic configuration at the moment is available in the RainRadarConfig.php script at the top… Most importantly when embeding in your own web page, make sure the onload=reload() is in the body tag!! otherwise this little gem won’t run.
Currently their are three user configurable options in the top of RainRadarConfig.php
$DefaultLocation = “IDR023”;
$ShowMenu = “1”;
$ShowTitle = “1”;
Default Location , is the initial rain radar you want to display when the page is loaded, IDR023 is the local Melbourne Rain Radar for me… Just look down the RainRadarConfig.php to find the code for your local rain radar.
ShowMenu Just enables or disables the pick list of rain radars from displaying. comment out the line if you dont want the pick list displayed.
ShowTitle Enables or Disables the title appearing above the rain radar.
At this stage, the code is pretty rough… It possibly has some bugs and security flaws… especially with the crude passing of the radar reference into the script via $_GET…
Documentation is lacking… Although you should be able to work your way around the scripts ok…
Thoughts, ideas, comments etc appreciated…
Cheers,
Dave.
RainRadar-v4.zip (9.56 KB)