Fix for local radar image in Galleon’s weather app

closeHey, just so you know ... this post is now about 15 years and 9 months old. Please keep that in mind as it very well may contain broken links and/or outdated information.

A few weeks ago, the Local Radar screen in Galleon‘s weather application started showing “N/A” instead of the image from weather.com. Galleon has been dormant, development-wise, for a while. It was updated late last year with some bug fixes and HD support by s2kdave and jtkohl, but has lapsed into the realm of unsupported (but really useful) applications.

s2kdave pointed me in the right direction as to which piece of the code contained the URLs for the local radar image (WeatherData.java). I’m not really a java programmer, but I can code, so I decided to take a look and see if I could figure out the problem. It took me a while, but the fix ended up being rather simple.

In the determineLocalRadar function there are two try blocks. The first section grabs the weather page for the user’s specified ZIP code:

GetMethod get = new GetMethod("http://www.weather.com/weather/map/" + mZip);

It then parses through that HTML looking for the following strings:

String REGEX = "var mapNURL = \"(.*)\";";

or

REGEX = "src=\"/maps/local/local(.*)\"";

This was used to detemine the URL of the web page containing the local radar image. The second try block then grabbed that page:

get = new GetMethod("http://www.weather.com"+ radarurl);

and parsed it for the URL of the image itself:

String REGEX = "NAME=\"mapImg\" SRC=\"([^\"]*)\"";

What I found is that the first web page (the ZIP code-specific one) now contained the local radar image, so there was no need for the first try block anymore (the one creating the radarurl variable). I removed the block and re-compiled the code.

It worked! I tested with three different area codes in Galleon and the proper local radar image was retrieved each time. Of course, I can’t stop weather.com from changing their layout again, but this should work for now.

You can download my new weather.jar file and place it in the apps directory where Galleon is installed. I also posted about my fix on the TiVo Community Forum here.

2 Comments

  1. ajayabb over on TCF pointed out that my fix displays the 100 mile radar map whereas originally Galleon would show the 600 mile map. It looks like it’ll be more complicated to pull that image (more complicated than my initial simple fix, anyway) but I’ll see if I can take a shot at it when I have some free time.

Leave a Reply

Your email address will not be published. Required fields are marked *