A flash weather module
In a year that was breaking all hot weather records (2006) I wanted to have an app that could display the local temperature prediction in a visual way: would it get unbearably hot today? And tomorrow? Getting the local weather by way of America, land of the free weather data.
Note: this describes the situation in 2006. See all posts related to weather
How to get good local European weather data for free
First step: get a simple xml data feed which would have local current temperatures and a few days’ forecast. Very disappointingly, the obvious source for the Netherlands (the KNMI) only has commercial services available that were way out of my league. Then there is a ready-made flash app from Germany which is free – but I just wanted the plain xml data and *fröbel* something in Flash myself.
Turns out the only free xml data feed for Europe is from America… where they feel weather info is in the public domain. In Europe, forecasts are seen as a commercial service – and thus the data must be paid for as well… The Weather Channel site has a form with which to construct a url for a local weather rss feed.
The rss url would look like this – for Utrecht, the Netherlands:
http://rss.weather.com/weather/rss/local/NLXX0018?cm_ven=LWO&cm_cat=rss&par=LWO_rss
Where the letter-number code NLXX0018 is the location ID for Utrecht.
note: this service has restricted the use of their rss feeds for display on your web page – see the terms of use
So the KNMI sends their data to The Weather Channel in the States, and I get my local KNMI data and forecast for free from across the pond. In fact, weather.com makes it a cinch to develop apps with their service, with an implementation guide and SDK for download at their site. And wonderful data too, with sunrise and sunset times and moon phases and whatnot!
Icons of American weather
Weather.com not only produces data feeds for any place you’d care to get weather data for, they also provide an SDK complete with icon set to use with the data feed.



weather.com icons
Now there’s the rub. Dutch weather features lots of varying cloud types; English weather, aside from the obvious rain, knows variations like foggy, gloomy or drizzly; but American weather apparently has “DUST” and “SMOKE” and “HAZE” as possible condition – after all, they have a fire season that we don’t. Also, in checking the received data against the current situation, it seemed to me that what is *really hot* to us, is nothing special in the States…
I felt our temperate clime was really looking boring and flat when displayed with American icons. And more importantly, the icons didn’t convey any info on the most important aspect (to me): the temperature.
By observing the returned icon and the actual weather outside, I was able to adjust the icons to our local situaltion. And doing the icons in flash gave me the opportunity to add the temperature as a color layer. Now the “hazy” condition still shows some sun, there is a much broader range of cloud – sizes going from a tiny wisp as a high cloud layer before the sun, to just an edge of sun behind a rain cloud, up to the big thunder “warships”. In this way the icons felt much more like the actual situation.


part of the new simple weather icon set for flash
Downside of the weather.com feed
There is one thing that you can recognize a weather.com feed by, and that is that it has a delay of more than two hours for “current” conditions. That means that at 10 AM, when the sun is heating up the day, the app was showing temperatures that were way cooler than in reality – it still returned the cool temps of the early morning. I don’t know if that’s only for European data. But my phone’s weather app also is showing this delay – and it gets its data from weather.com.
Flash as the front end
And not using those standard gif icons had another advantage as well. Using Flash as the xml reader I was able to combine two separate data items in one image: the background of the weather icon (1) gets its colour from the temperature (2). The same combination thing could be done with the moon phases data. Instead of using the static full moon icon on a cloudless night, I combined a moon in current phase with the weather icon on top and a dark night sky in the background. Now the only thing lacking is to have actual morning- and evening glow at the proper times :-) It’s not for lack of data…

showing moon phase and early nightfall in winter

Updated – now also showing storm warnings for wind speeds over 80 km/h. (also note the darker night sky when the moon is new)
how to get the flash to display the external xml feed
Of course, Flash won’t read the weather.com feed directly; it will not read cross-domain xml data. The well-known way to solve this is by using a so-called local proxy: the Flash asks for a file from the same server as where it’s hosted, and this file (the local proxy) asks for the data on the remote server, which it then passes on to the Flash. See the snippets section for a proxy example.
External Interface: get the weather into the conversation
And best of all, Flash gives me the opportunity to use its External Interface and let other flash objects on the page know about the current weather.
I could trigger a conversation in the chat app with a remark about the temperatures, just like you’d do in real life. I’m looking forward to be implementing that in the next conversation app release.
What it looks like: screendumps
In projects:
Featured projects:
Most popular:
RSS Links