Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4019) - 03 April 2024

Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

broken weather underground forecast?

Discussion of Ken True's web site templates

Moderator: saratogaWX

Sadgit
Posts: 192
Joined: Sun 04 Jan 2009 5:56 pm
Weather Station: Vantage Vue
Operating System: Windows 7
Location: Middlesbrough, England

broken weather underground forecast?

Post by Sadgit »

just today I have started getting
Warning: Division by zero in /xxxxxxxxx/weather/WU-forecast.php on line 764

http://www.marton-weather.co.uk/

and I haven't changed anything in weeks, have WU changed their code recently?
If I go to the forecast I get the same
http://www.marton-weather.co.uk/wxforecast.php

but the link still works fine
http://www.wunderground.com/cgi-bin/fin ... IMIDDLES24


Any ideas please?
Cheers
Mark
User avatar
saratogaWX
Posts: 1185
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: broken weather underground forecast?

Post by saratogaWX »

Update to V2.06 of WU-forecast.php -- WeatherUnderground did a bit of page format changing on 13-Oct-2014 and that broke V2.05 of the script.
Sadgit
Posts: 192
Joined: Sun 04 Jan 2009 5:56 pm
Weather Station: Vantage Vue
Operating System: Windows 7
Location: Middlesbrough, England

Re: broken weather underground forecast?

Post by Sadgit »

saratogaWX wrote:Update to V2.06 of WU-forecast.php -- WeatherUnderground did a bit of page format changing on 13-Oct-2014 and that broke V2.05 of the script.
You are brilliant, thanks Ken
User avatar
nitrx
Posts: 1297
Joined: Sun 13 Dec 2009 1:21 pm
Weather Station: WH1080
Operating System: Windows 10
Location: Apeldoorn The Netherlands
Contact:

Re: broken weather underground forecast?

Post by nitrx »

saratogaWX wrote:Update to V2.06 of WU-forecast.php -- WeatherUnderground did a bit of page format changing on 13-Oct-2014 and that broke V2.05 of the script.
V2.06 doesn't work ? http://apeldoorn.tk/weer/wxforecast.php?lang=en
Sadgit
Posts: 192
Joined: Sun 04 Jan 2009 5:56 pm
Weather Station: Vantage Vue
Operating System: Windows 7
Location: Middlesbrough, England

Re: broken weather underground forecast?

Post by Sadgit »

it works for me thanks, but on the index outlook top right, it now shows the "today" instead of "tonight" and further down and on the forecast pages, it shows "today", "today", Tomorrow", "tomorrow" "friday", friday" instead of having the work night when it is the forecast for the night.

http://www.marton-weather.co.uk/

Sure I did something to make that work before, not major just a minor issue. :)

Cheers
Mark
User avatar
saratogaWX
Posts: 1185
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: broken weather underground forecast?

Post by saratogaWX »

WU-forecast.php V2.07 - 15-Oct-2014 is now available.

It seems that WeatherUnderground snuck in some ISO-8859-1 characters in station names instead of converting them to UTF-8 as required by the JSON json_decode() function. The script now spots that issue, runs the JSON through a utf8_encode() function and checks it for UTF-8 goodness.

This issue was causing 'no forecasts' for some international sites that have names with letters with diacritical marks (like umlaut, ring, cedilla, etc).

The period names in the forecast are all from WU and the JSON they produce. The script just shows their text since WU-forecast.php doesn't do language translation -- it relies on WU to do that and put the correct period names in the chosen language.

Best regards,
Ken
User avatar
nitrx
Posts: 1297
Joined: Sun 13 Dec 2009 1:21 pm
Weather Station: WH1080
Operating System: Windows 10
Location: Apeldoorn The Netherlands
Contact:

Re: broken weather underground forecast?

Post by nitrx »

Thanks Ken it works again great job
Ron
User avatar
gluepack
Posts: 460
Joined: Tue 22 Jan 2013 9:20 pm
Weather Station: PCE-FWS 20
Operating System: Win 7 Pro
Location: Zlatina, Bulgaria

Re: broken weather underground forecast?

Post by gluepack »

Wow, how come it only started to fail for me today?

Anyway, I will try the new version.
Image

PWS links: WundergroundIVARNAPR3CWOP/APRSE(W)2048PWSWeatherZLATINABGAwekas10631Twitter@Zlatina_weather
Station type: PCE-FWS 20…Webcam link: View south to edge of Provadisko plateau
User avatar
gluepack
Posts: 460
Joined: Tue 22 Jan 2013 9:20 pm
Weather Station: PCE-FWS 20
Operating System: Win 7 Pro
Location: Zlatina, Bulgaria

Re: broken weather underground forecast?

Post by gluepack »

I really should keep a list of mods that I make.
I make some slight mods to cater for 10 day and to space out WeatherUnderground (I guess, unless you have changed that) but I notice that despite setting maxwidth and maxicons up front, you override them later on. I must remember that I have to change them too.

As with Sadgit, I have a problem on the index page with Today Today (sounds like a premature Annie song) showing instead of Today Tonight. Oh forget that, perhaps it was a cache problem or Weather Underground even as the 10 day forecast shows as Thursday/Thursday night, Tomorrow/Tomorrow, Saturday/Saturday, etc..
Image

PWS links: WundergroundIVARNAPR3CWOP/APRSE(W)2048PWSWeatherZLATINABGAwekas10631Twitter@Zlatina_weather
Station type: PCE-FWS 20…Webcam link: View south to edge of Provadisko plateau
Sadgit
Posts: 192
Joined: Sun 04 Jan 2009 5:56 pm
Weather Station: Vantage Vue
Operating System: Windows 7
Location: Middlesbrough, England

Re: broken weather underground forecast?

Post by Sadgit »

Thnks Ken. I am still getting the problem I had before.. any ideas please?
Sadgit wrote:it works for me thanks, but on the index outlook top right, it now shows the "today" instead of "tonight" and further down and on the forecast pages, it shows "today", "today", Tomorrow", "tomorrow" "friday", friday" instead of having the work night when it is the forecast for the night.

http://www.marton-weather.co.uk/

Sure I did something to make that work before, not major just a minor issue. :)

Cheers
Mark
cbnidk
Posts: 22
Joined: Sat 07 Jan 2012 1:03 pm
Weather Station: WS3080
Operating System: windows server 2019 64 bit
Location: Denmark

Re: broken weather underground forecast?

Post by cbnidk »

Hi

I have the same error in Danish no "nat" on the page, nat = night

Claus
Last edited by cbnidk on Sat 18 Oct 2014 10:30 am, edited 1 time in total.
User avatar
SpaceWalker
Posts: 67
Joined: Sun 04 Mar 2012 2:54 am
Weather Station: Davis Vantage
Operating System: Windows XP
Location: Eastern-Canada
Contact:

Re: broken weather underground forecast?

Post by SpaceWalker »

Indeed, I have noticed the same situation where the name of the days are duplicated whereas the forecasts are different.

So, rather than bothering Ken, I have looked at the code, found the location where the variable '$nowdaytime' is located and added a few lines of code to take care of the missing 'tonight/night' words (it is my belief that Ken has been quite busy having to modify, if not to completely rewrite, the two scripts handling the forecasts and radar information from Environment Canada).
cbnidk
Posts: 22
Joined: Sat 07 Jan 2012 1:03 pm
Weather Station: WS3080
Operating System: windows server 2019 64 bit
Location: Denmark

Re: broken weather underground forecast?

Post by cbnidk »

Hi

I have found the problem why the night is missing in line 674

foreach(array('day','night') as $dnpart) { Change to

foreach(array('day','Night') as $dnpart) {

Then the night is back but now the forecast and the picture is missing for the night
someone can fix this?

http://vejr.bloknet.dk/php/wxforecast.php

my site is in Danish but can be change to english if you like

Claus
User avatar
saratogaWX
Posts: 1185
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: broken weather underground forecast?

Post by saratogaWX »

As I said above
The period names in the forecast are all from WU and the JSON they produce. The script just shows their text since WU-forecast.php doesn't do language translation -- it relies on WU to do that and put the correct period names in the chosen language.
The issue with day/night names is the fault of Wunderground .. their JSON has a bug in it for 'night' in the title: field (which is used by the script for the period name in the selected language). WU-forecast doesn't do translation.. WU does. There is not a good (general) solution to this issue except to have WU fix their own JSON. Yes, individuals may choose to modify the script to produce the missing item, but it would be for a single-language and not applicable to both standalone/template users worldwide.

There are other quirks with the JSON that cause issues, particularly around the times the forecast is rolling over to a new day on the WU site, and I can't fix that either :(

Best regards,
Ken
cbnidk
Posts: 22
Joined: Sat 07 Jan 2012 1:03 pm
Weather Station: WS3080
Operating System: windows server 2019 64 bit
Location: Denmark

Re: broken weather underground forecast?

Post by cbnidk »

saratogaWX wrote:As I said above
The period names in the forecast are all from WU and the JSON they produce. The script just shows their text since WU-forecast.php doesn't do language translation -- it relies on WU to do that and put the correct period names in the chosen language.
The issue with day/night names is the fault of Wunderground .. their JSON has a bug in it for 'night' in the title: field (which is used by the script for the period name in the selected language). WU-forecast doesn't do translation.. WU does. There is not a good (general) solution to this issue except to have WU fix their own JSON. Yes, individuals may choose to modify the script to produce the missing item, but it would be for a single-language and not applicable to both standalone/template users worldwide.

There are other quirks with the JSON that cause issues, particularly around the times the forecast is rolling over to a new day on the WU site, and I can't fix that either :(

Best regards,
Ken
Have you seen my page all language have night if line 674 is change but if the forecast can't come back with this change it is not a way

http://vejr.bloknet.dk/php/wxforecast.php

Claus
Post Reply