WXforum.net

Web Weather => Weather Website PHP/AJAX scripting => Topic started by: LeFuet on June 22, 2018, 03:44:52 AM

Title: Error in WU-forecast.php
Post by: LeFuet on June 22, 2018, 03:44:52 AM
How do I get rid of this error, I can not remember that I changed something there:
Warning: Division by zero at /var/www/vhosts/euro-picture.de/httpdocs/wetterstation/cumulus/WU-forecast.php on line 638

www.wetter.euro-picture.de (http://www.wetter.euro-picture.de)

Title: Re: Error in WU-forecast.php
Post by: saratogaWX on June 22, 2018, 11:28:46 AM
It is caused by the URL you selected for the default forecast - it is incomplete (missing lat,long)

Change it to
Code: [Select]
https://www.wunderground.com/weather/de/hiltenfingen/48.1535502%2C10.6805879 and the script should work fine.

Any of the wunderground urls that are of the format /weather/{country}/{city} require a /{latitude},{longitude} to be used with the script.
Title: Re: Error in WU-forecast.php
Post by: LeFuet on June 22, 2018, 11:48:53 AM
even after modification, the error remains
Title: Re: Error in WU-forecast.php
Post by: saratogaWX on June 22, 2018, 01:05:49 PM
I'm not sure you made the change effective.  Your Settings.php still has
Code: [Select]
'Hiltenfingen|https://www.wunderground.com/weather/de/hiltenfingen', //Hiltenfingen, Deutschland
and needs to have
Code: [Select]
'Hiltenfingen|https://www.wunderground.com/weather/de/hiltenfingen/48.1535502%2C10.6805879', //Hiltenfingen, Deutschland

That is why the error persists.
Title: Re: Error in WU-forecast.php
Post by: LeFuet on June 22, 2018, 02:17:06 PM
Thank you for your help

recards
Title: Re: Error in WU-forecast.php
Post by: saratogaWX on June 22, 2018, 02:22:45 PM
I would suggest changing both.  The first entry in the $SITE['WUforecasts'] = array( will override the contents of the $SITE['fcsturlWU'] entry, but having them the same is still a good idea.
Title: Re: Error in WU-forecast.php
Post by: saratogaWX on June 22, 2018, 03:30:03 PM
Also, you need to install the icons used for the forecast .. download https://saratoga-weather.org/saratoga-icons2.zip

Unzip to your document root and upload the entire forecast/ set of directories and images to your website so that you have
./forecast
./forecast/images
./forecast/icon-templates
DualImage.php

all in your document root.  Yes, the upload may take a while.. there are a lot of images to upload.
Title: Re: Error in WU-forecast.php
Post by: LeFuet on June 22, 2018, 07:28:47 PM
Thank you very much, it looks very good so far! I could not have done that without you!

Best regards
Harry
Title: Re: Error in WU-forecast.php
Post by: bianconero57 on July 14, 2018, 11:13:03 AM
good evening
i join the thread I can not run the script WU for forecasts
http://seremange-meteolive.franceserv.com/realtime/wxindex.php

Forecast blank? Force Update !
http://seremange-meteolive.franceserv.com/realtime/wxforecast.php

thanks in advance
kind regards
Title: Re: Error in WU-forecast.php
Post by: saratogaWX on July 14, 2018, 11:22:54 AM
I think you have an incorrect URL for the WU-forecast.php script.

Change
Code: [Select]
https://www.wunderground.com/weather/fr/ser%C3%A9mange-erzange/49.32C6.09 to
Code: [Select]
https://www.wunderground.com/weather/fr/ser%C3%A9mange-erzange/49.32%2C6.09 and it should work fine.

Note: after the change, you may have to do ?force=1 to refresh the cache to see the change in effect.
Title: Re: Error in WU-forecast.php
Post by: bianconero57 on July 15, 2018, 09:56:36 AM
 =D> thank you solved with the good url and also by downloading the latest update of WU-forecast.php to try to solve the problem of cache files without forecast information
kind regards
Title: Re: Error in WU-forecast.php
Post by: ea1hmy on August 06, 2018, 05:04:41 AM
Hi, I can not get it to work for me WU-forecast
in :
http://meteotrevelez.com/saratoga/WU-forecast.php
the address that I have put:
$WUAPIkey = 'c5f9d31fxxxxxxx';

$ WU_URL = 'https://www.wunderground.com/weather/en/Trevelez/37.0594752

some help
thank you very much
Emilio
Title: Re: Error in WU-forecast.php
Post by: ConligWX on August 06, 2018, 05:30:19 AM
Your wu-forecast module is out of date

http://meteotrevelez.com/saratoga/check-fetch-times.php?show=versions

Update it
Title: Re: Error in WU-forecast.php
Post by: ea1hmy on August 06, 2018, 06:49:28 AM

Updated, still not working
Title: Re: Error in WU-forecast.php
Post by: ConligWX on August 06, 2018, 07:36:50 AM
delete the forecast cache txt files.

should be something like WU-forecast-0-en.txt and WU-forecast-json-0-en.txt

then refresh the page

http://meteotrevelez.com/saratoga/WU-forecast.php?force=1
Title: Re: Error in WU-forecast.php
Post by: ConligWX on August 06, 2018, 07:47:58 AM
Also try using this as the URL

$WU_URL = https://www.wunderground.com/cgi-bin/findweather/getForecast?query=pws:ITREVLEZ2

have you set this in WU-forecast.php or settings.php?
Title: Re: Error in WU-forecast.php
Post by: ConligWX on August 06, 2018, 07:51:01 AM
you also have this:

Quote
//$WUAPIkey = 'specify-for-standalone-use-here'; // use this only for standalone / non-template use
// NOTE: if using the Saratoga template, add to Settings.php a line with:
    $SITE['WUAPIkey'] = 'c5f9d31xxxxxxxxxx';


this goes in your Settings.php

$SITE['WUAPIkey'] = 'c5f9d3xxxxxxxx';


$WUAPIkey = 'c5f9d3xxxxxxxx';

would go in your WU-forecast.php
Title: Re: Error in WU-forecast.php
Post by: ea1hmy on August 06, 2018, 08:19:38 AM

thank you very much to all
with the changes, it still does not work
now it's with:
$ WU_URL = https://www.wunderground.com/cgi-bin/findweather/getForecast?query=pws:ITREVLEZ2
it is blank
Title: Re: Error in WU-forecast.php
Post by: ConligWX on August 06, 2018, 08:23:59 AM
I'm getting http 500 errors on this URL so something is not right with the file.

http://meteotrevelez.com/saratoga/WU-forecast.php?sce=view
Title: Re: Error in WU-forecast.php
Post by: ea1hmy on August 06, 2018, 08:50:41 AM
I get the blank page
thanks for your help
I give up
I forget her
Title: Re: Error in WU-forecast.php
Post by: saratogaWX on August 06, 2018, 10:57:25 AM
Did you try using

Code: [Select]
$WU_URL = 'https://www.wunderground.com/weather/es/trevelez/37.0,-3.27';
for the URL?
Title: Re: Error in WU-forecast.php
Post by: ea1hmy on August 06, 2018, 11:18:44 AM
Thank you very much Ken
I had put it minus the longitude
now it works correctly