WXforum.net
Web Weather => Weather Website PHP/AJAX scripting => Topic started 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)
-
It is caused by the URL you selected for the default forecast - it is incomplete (missing lat,long)
Change it to 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.
-
even after modification, the error remains
-
I'm not sure you made the change effective. Your Settings.php still has
'Hiltenfingen|https://www.wunderground.com/weather/de/hiltenfingen', //Hiltenfingen, Deutschland
and needs to have 'Hiltenfingen|https://www.wunderground.com/weather/de/hiltenfingen/48.1535502%2C10.6805879', //Hiltenfingen, Deutschland
That is why the error persists.
-
Thank you for your help
recards
-
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.
-
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.
-
Thank you very much, it looks very good so far! I could not have done that without you!
Best regards
Harry
-
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
-
I think you have an incorrect URL for the WU-forecast.php script.
Change https://www.wunderground.com/weather/fr/ser%C3%A9mange-erzange/49.32C6.09
to 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.
-
=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
-
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
-
Your wu-forecast module is out of date
http://meteotrevelez.com/saratoga/check-fetch-times.php?show=versions
Update it
-
Updated, still not working
-
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
-
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?
-
you also have this:
//$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
-
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
-
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
-
I get the blank page
thanks for your help
I give up
I forget her
-
Did you try using
$WU_URL = 'https://www.wunderground.com/weather/es/trevelez/37.0,-3.27';
for the URL?
-
Thank you very much Ken
I had put it minus the longitude
now it works correctly