Author Topic: Error in WU-forecast.php  (Read 1118 times)

0 Members and 1 Guest are viewing this topic.

Offline LeFuet

  • Member
  • *
  • Posts: 18
Error in WU-forecast.php
« 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


Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Error in WU-forecast.php
« Reply #1 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.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline LeFuet

  • Member
  • *
  • Posts: 18
Re: Error in WU-forecast.php
« Reply #2 on: June 22, 2018, 11:48:53 AM »
even after modification, the error remains

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Error in WU-forecast.php
« Reply #3 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.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline LeFuet

  • Member
  • *
  • Posts: 18
Re: Error in WU-forecast.php
« Reply #4 on: June 22, 2018, 02:17:06 PM »
Thank you for your help

recards
« Last Edit: June 22, 2018, 02:20:51 PM by LeFuet »

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Error in WU-forecast.php
« Reply #5 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.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Error in WU-forecast.php
« Reply #6 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.
« Last Edit: June 22, 2018, 03:31:49 PM by saratogaWX »
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline LeFuet

  • Member
  • *
  • Posts: 18
Re: Error in WU-forecast.php
« Reply #7 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

Offline bianconero57

  • Contributor
  • ***
  • Posts: 131
    • Valdefensch@57
Re: Error in WU-forecast.php
« Reply #8 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

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Error in WU-forecast.php
« Reply #9 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.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline bianconero57

  • Contributor
  • ***
  • Posts: 131
    • Valdefensch@57
Re: Error in WU-forecast.php
« Reply #10 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

Offline ea1hmy

  • Contributor
  • ***
  • Posts: 120
    • meteotorrelavega
Re: Error in WU-forecast.php
« Reply #11 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
« Last Edit: August 06, 2018, 05:06:48 AM by ea1hmy »

Offline ConligWX

  • Forecaster
  • *****
  • Posts: 836
  • #conligwx
    • conligwx.org
Re: Error in WU-forecast.php
« Reply #12 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
Regards Simon
Davis Vantage Pro2 Plus (6162UK) • Daytime FARS • WeatherLink Live • AirLink • PurpleAir PA-II-SD • CumulusMX •


Offline ea1hmy

  • Contributor
  • ***
  • Posts: 120
    • meteotorrelavega
Re: Error in WU-forecast.php
« Reply #13 on: August 06, 2018, 06:49:28 AM »

Updated, still not working

Offline ConligWX

  • Forecaster
  • *****
  • Posts: 836
  • #conligwx
    • conligwx.org
Re: Error in WU-forecast.php
« Reply #14 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
Regards Simon
Davis Vantage Pro2 Plus (6162UK) • Daytime FARS • WeatherLink Live • AirLink • PurpleAir PA-II-SD • CumulusMX •


Offline ConligWX

  • Forecaster
  • *****
  • Posts: 836
  • #conligwx
    • conligwx.org
Re: Error in WU-forecast.php
« Reply #15 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?
Regards Simon
Davis Vantage Pro2 Plus (6162UK) • Daytime FARS • WeatherLink Live • AirLink • PurpleAir PA-II-SD • CumulusMX •


Offline ConligWX

  • Forecaster
  • *****
  • Posts: 836
  • #conligwx
    • conligwx.org
Re: Error in WU-forecast.php
« Reply #16 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
« Last Edit: August 06, 2018, 08:07:59 AM by Toxic »
Regards Simon
Davis Vantage Pro2 Plus (6162UK) • Daytime FARS • WeatherLink Live • AirLink • PurpleAir PA-II-SD • CumulusMX •


Offline ea1hmy

  • Contributor
  • ***
  • Posts: 120
    • meteotorrelavega
Re: Error in WU-forecast.php
« Reply #17 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

Offline ConligWX

  • Forecaster
  • *****
  • Posts: 836
  • #conligwx
    • conligwx.org
Re: Error in WU-forecast.php
« Reply #18 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
Regards Simon
Davis Vantage Pro2 Plus (6162UK) • Daytime FARS • WeatherLink Live • AirLink • PurpleAir PA-II-SD • CumulusMX •


Offline ea1hmy

  • Contributor
  • ***
  • Posts: 120
    • meteotorrelavega
Re: Error in WU-forecast.php
« Reply #19 on: August 06, 2018, 08:50:41 AM »
I get the blank page
thanks for your help
I give up
I forget her

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Error in WU-forecast.php
« Reply #20 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?
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline ea1hmy

  • Contributor
  • ***
  • Posts: 120
    • meteotorrelavega
Re: Error in WU-forecast.php
« Reply #21 on: August 06, 2018, 11:18:44 AM »
Thank you very much Ken
I had put it minus the longitude
now it works correctly
« Last Edit: August 06, 2018, 11:56:21 AM by ea1hmy »

 

anything