WUForecast.php problem with new WU website


I use the WU forecast with AJAX templates for my WS (www.maltaws.com). Since today the WU forecast stopped working and I noticed that it is due to a change in their website.

Changing the URL from http://www.wunderground.com/global/stations/16597.html to http://classic.wunderground.com/global/stations/16597.html seems to have solved the issue, at least temporarily.

Are there any updates to the script to cater for the new website layout since I believe the classic site will not be in existance forever !

I believe I am not the only one having this problem though I have found nothing on the net so far. Right?


yes, same here but using the classic fails for me, still get division by zero errors :frowning:

I started this thread early this morning http://discourse.weather-watch.com/t/49824


I managed to get it working again using the “classic” site, but had to delete the WU-forecast.txt cache file and refresh the browser, now it works again.

did try deleting the cache file before, did not work for me, still fails :frowning:
I wonder whats different then as it works for others ?

The new site probably has not filtered through too all the WU servers or they are just testing on some servers and not others. But I am sure the new pages will eventually arrive at all points N S E W. :slight_smile:


Solved the error, I wasnt changing the url in the settings file only in the script, it was being overwritten by settings #-o silly me

Mh…I changed the url to “classic” in settings…also in the script settings…deleted the cache file…refreshed the browser…

…but nothing happen, I’m always getting the division by zero error :frowning:

…I deleted also the browser cache

Yes, changing the ‘www’ to ‘classic’ in the Wunderground URL in Settings.php is a good way to bypass the issue and works for the English-only templates. The Multilingual version will fail as all the translations use the new site format.

I’m working on updates to the scripts now :slight_smile:

Whew… what a chore. They really did change a lot of the page HTML, but I’ve finished the mods to the WU-forecast.php script to support their new website design.

Download from http://saratoga-weather.org/scripts-WUforecast.php#WUforecast

Please note that there are two versions of the script, one for the English-only (World template) or standalone use, and
one for the World-ML template. Be sure you download the correct version for your website!

The $WUforecastupdated variable is no longer set by the script since their pages do not contain a ‘date of the forecast’.

All the forecasts are now in Metric units in both under-icon min/max and in the text forecasts. That does mean the wind forecast only appears in km/h (and not in mph and km/h). They don’t appear to be honoring the ‘both’ selection for type of units, so I set it to metric so it will not annoy folks with pesky imperial units anymore :slight_smile:

A caveat about the multilingual forecasts: the script does not do any language translation of what WU returns. If you have an issue with wording of the forecasts, please send WeatherUnderground a note regarding updating their translation … it’s not something I can fix with the script.

Best regards,

Thanks Ken.

Dutch translation is still a mess but I know it’s not your fault.

I’m hoping I don’t need this script for my site…I don’t want metric readings…my forecast is still working…sure wish I could run WXSim on the Mac…


Not sure if you saw but one of the features of the new website is a new forecast system they are employing. They now have their own “BestForecast” using a proprietary modeling system and then the standard ones.

It might be fun if there was a way to choose which one to use with the script, even for us in the U.S. that normally use NWS.

I freely admit I haven’t entirely figured out how to tell which one is displaying on their site though. :frowning:

Here’s the press release with a description.


Hi Ken,

first of all I want thank you for the great and very quick upgrade of the script…

…but I have a little problem:

you said that from now all forecasts are in metric units but in my website they appears in imperial units…
…what should I do?


Hi Alex,
I think you just had to wait for the cache page to expire and be refreshed…
http://www.meteocampigiano.it/wxforecast.php does show metric units now :slight_smile:

Best regards,

Yes, the translations for German are worse … hopefully folks will give them direct feedback about the translations, and
that ‘water equivalent of’ is missing a translation in all the other languages.

You don’t need this script Dan… the WU-forecast.php is only for non-USA, non-Canada users. Stick with the advforecast2.php (NOAA) forecast for the USA and the ec-forecast.php (Environment Canada) for Canada.

Regrettably, their forecasts for the USA are from the NWS (so you see the same data as advforecast2.php provides, minus the active alerts for the area). They switched Canada weather from the EC to their new forecast system, so the script could be used in Canada (but without reporting current conditions and alerts like the ec-forecast.php script does).

Ohhhhhhhhh, I’m so sorry…I haven’t thought about the cache!

…Thanks again,



As usual, thanks for a quick response to this, it’s really appreciated … cheers


As always many thanks



Thank you very much for your quick action on this matter!!