What’s the weather like out there?

Another popular portal application I have seen is weather information. Not only current conditions, but forecasts too. Now weather.com offers a JavaScript solution where you can place a predesigned block on your portal with current and forecast conditions, but this has two drawbacks.

First, the script is executed every time the wrapper page realods. This adds an enormous load to your network and will most likely get your network admins on your back. Second drawback is since it is an external resource, all users need internet access. Far be it from me to judge, but there are still ALOT of archaic organizations out there that give internet access to a very small user population. Even some content filters, like WebSense, will block weather sites (no idea why).

Here is a better way; get some use from those tax dollars you pay uncle sam and use the free weather service provided by the National Oceanic and Atmospheric Administration (NOAA, pronounced like Noah).


They have two offerings you can take advantage of. The first is the current conditions XML feed. You can pick your location starting here and once you have the location, you can directly reference the file. For Buffalo, I use this file.

You can have your portal retrieve these results every hour and cache them locally to avoid the above issues. I like to trim out the parts I do not use, and store a revised XML file in the file system of the portal server. You can also take advantage of all these AJAX references and create a client side JavaScript that refreshes from this file only at predetermined intervals.

The second NOAA offering is forecast info which they offer as a web service. You can request any number of days, and if you want 4/12/24 hour breakdowns. They only offer examples using PHP (why?), but Web Services are nothing more than HTTP posts anyway, so you can just create your request envelope and post it.

Every customer I have ever implemented these offerings has been surprised at its popularity, and thankful for the decrease in traffic across already burdened internet connections.

One Response to “What’s the weather like out there?”

  1. My Portal Project » Blog Archive » Welcome to last year slashDot Says:

    […] It is rare for me, but it feels good to be ahead of the curve. […]