Weather Mashup


An updated version of my weather userbar using XML from NWS paired with a geocode search.

Although I like my existing weather userbar, I really wanted an easier city search. I decided to stick with NOAA and the NWS for now and ran across a nice all in one weather page with an XML link. The XML requires latitude and longitude meaning I need to find a way to find your city from a search string. Here is where the mash-up comes in. After a quick search, I found the Google Geocoding API. It accepts just about any search string and returns the closest match with the coordinates I need. The result isn't much different, but the location is easier to read.

[Image]

https://www.reids4fun.com/ub/weather.png?loc=Boise%2C%20ID

Note that this API provides a lot more information than the original one I was using. I will be able to create forecasts, give more detailed weather information, etc. However, there is a minor bug in the current conditions icon that shows partly cloudy instead of clear. Another problem is that the weather is only for the US. I might look for other API's, but I do like the detail provided by NOAA. If you want to give it a try yourself, hit up this link and let me know what you think.

Updated 12/20/2018:
While working to move my weather userbar to to my main site, I discovered the geocode API had stopped working. Apparently, Google had decided to change how it worked. Not all that interested in creating new accounts, I found an alternative. It isn’t quite as robust, but it works.

As such, the new version of my Weather Userbar is now working on this site! Beside creating a new landing page for it, I also converted it to use Imager.pm, like the rest of the new signatures. This gave me a chance to fix the clear condition bug as well.

Updated 3/5/2023:
As things seem to change, so do API’s, I had to fix this once in 2021 and again today in 2023. I’m using the API from Maps Free Geocoding API to get things to work. Although good enough for this experiment, I really should rework this whole process.



Comments on this article:

No comments so far.

Write a comment:

Type The Letters You See.
[captcha image][captcha image][captcha image][captcha image][captcha image][captcha image]
not case sensitive