Sunday, September 13, 2009

Free Australian weather widget

It is time to launch another web widget: live weather information for 196 localities in Australia. It is free to use for any website - all I ask for is just tell others about it! Information is coming from the Australian Bureau of Meteorology (BOM) every half an hour so, it is official weather data. Currently, there are four display options:

  • current temperature and today’s forecast for all capital cities (default view);
  • current observations for a specific location (temp, dew point, barometric pressure, humidity, visibility and rain since 9am);
  • graph displaying temperature changes in the last 24 hrs (min, max and current temperatures are marked for information);
  • 7 day forecast for a given location (shorter forecasts for minor localities).

Visitors have the ability to check weather information for specific towns or localities by typing the name of location of interest in the input box. Auto look-up function shows matching names as text is typed in.

The widget can be embedded in any website with a simple line of code and there is an option to set the city, info tab and top bar colour to suite your requirements. Full setup instruction is provided on site.

This is the second weather widget that I am sharing with others through my site. The fist one, build with free service provided by, was released in 2006 and was part of front page design since day one. I will maintain it indefinitely for anyone interested but the future development will focus on my new creation.

Briefly about the new widget, from a technical point of view. I have already been using BOM’s Web Feature Service for my weather map, snow map for NSW and snow map for Victoria so, when I decided to update the widget, it was easy decision as to the source of the data. On the back end, I use CRON jobs to call BOM service at regular intervals and PHP script to convert weather information (current temperature and forecasts), delivered in XML format, to MySQL database. Matching weather stations with localities was a bit of a challenge since “forecast locations” do not relate directly to “weather station names”.

The front end is built with jQuery JavaScript library and auto look-up extension. It was the only way to provide “links” to 196 locations in such a confined space. Temperature graph was a late addition but I believe it was worth the effort. Complexity of generating the graph using Google Chart service is not trivial but it was either this approach or using PHP GD image processing library. Managing “time” for multiple time zones was another challenge – so, until I come up with something better, time displayed in the widget will always refer to user local time (derived from computer's internal clock).

Your comments and suggestions for improvements, as usual, most welcome!

1 comment:

Ando said...

Thanks for your work on this weather widget, its exactly what I was looking for.