Author Topic: Advforecast script error  (Read 317 times)

0 Members and 1 Guest are viewing this topic.

Offline Gerry0587

  • Senior Member
  • **
  • Posts: 70
Advforecast script error
« on: May 02, 2024, 07:29:51 PM »
Hello! Recently I’m dealing with this error in the script. °F I will appreciate any help to solve the issue. Thanks!

Online saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9332
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Advforecast script error
« Reply #1 on: May 02, 2024, 07:45:37 PM »
Looks like you are using an older version 4.x of advforecast2.php -- the NWS recently changed the point-printable forecast to flip the temperature and conditions rows in their table.  https://saratoga-weather.org/scripts-carterlake.php has the download for advforecast2.php V4.06 which fixes that, but update to the V5.19 script that uses the API instead will insulate you from future forecast.weather.gov website changes.
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 Gerry0587

  • Senior Member
  • **
  • Posts: 70
Re: Advforecast script error
« Reply #2 on: May 02, 2024, 08:39:59 PM »
Problem fixed. I really appreciate it!

Offline ValentineWeather

  • Forecaster
  • *****
  • Posts: 6379
    • Valentine Nebraska's Real-Time Weather
Re: Advforecast script error
« Reply #3 on: May 03, 2024, 10:10:56 AM »
I was seeing the same thing with the older script. The latest 5.19 fixed it.
Randy

Offline AZmonsooncats

  • Current weather conditions in North Phoenix, Ariz
  • Senior Contributor
  • ****
  • Posts: 252
  • Me & My Little Sis!!
    • Pepper Ridge North Valley  Weather and Lightning
Re: Advforecast script error
« Reply #4 on: May 03, 2024, 10:47:13 PM »
Tried updating for this issue to V5.19 it fix &degf issue but  the select a forecast option broke, advise please I was using V4.03

http://www.pepperridgenorthvalley.com/Forecast_Details.php

Jeanette
« Last Edit: May 03, 2024, 11:22:48 PM by AZmonsooncats »
"Some dreams are in the night time, And some seem like yesterday
But leaves turn brown and fade, Ships sail away
You long to say a thousand words…but Seasons Change."



CWOP:CW3794, MesoWest: C3794, Facebook: https://www.facebook.com/PepperRidgeNorthValleyWX/

Online saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9332
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Advforecast script error
« Reply #5 on: May 03, 2024, 11:22:05 PM »
Hi Jeanette,
Two issues:
1) your first forecast has an incorrect zone
Quote
<!-- WARNING: NOAAZone='AZZ023' is not correct.  Will use 'AZZ542' for this point location per NWS. -->
so change AZZ023 to AZZ542.
2) your setting inside the script of
Quote
/*
$NWSforecasts = array(
means that the entire $NWSforecasts definition is a comment (ignored by PHP).
change that to
Quote
//*
$NWSforecasts = array(
to disable the comment.
Do check the Forecast Zones you specified for Arizona.. they've changed last year for some regions.  It's important to have the correct ones for failover to the zone forecast if the point forecast isn't available.  After you make the above correction,
you can do view-source:http://www.pepperridgenorthvalley.com/advforecast2.php?z=N (where N=0.. number of entries in $NWSforecasts array -1) to see the loading.  If you see a message like
Quote
<!-- WARNING: NOAAZone='AZZ023' is not correct.  Will use 'AZZ542' for this point location per NWS. -->
it will show you the correct Zone to use for that entry.
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 AZmonsooncats

  • Current weather conditions in North Phoenix, Ariz
  • Senior Contributor
  • ****
  • Posts: 252
  • Me & My Little Sis!!
    • Pepper Ridge North Valley  Weather and Lightning
Re: Advforecast script error
« Reply #6 on: May 03, 2024, 11:38:53 PM »
Opps  #-o I missed this was a simple issue

Quote
Two issues:
1) your first forecast has an incorrect zone
Quote

    <!-- WARNING: NOAAZone='AZZ023' is not correct.  Will use 'AZZ542' for this point location per NWS. -->

so change AZZ023 to AZZ542.
2) your setting inside the script of
Quote

    /*
    $NWSforecasts = array(

means that the entire $NWSforecasts definition is a comment (ignored by PHP).
change that to
Quote

    //*
    $NWSforecasts = array(

to disable the comment.
Do check the Forecast Zones you specified for Arizona.. they've changed last year for some regions.  It's important to have the correct ones for failover to the zone forecast if the point forecast isn't available.  After you make the above correction,

The select a forecast is now working again. I will have to check the zones.

Here's the current array

Code: [Select]
$NWSforecasts = array(
 // the entries below are for testing use.. replace them with your own entries if using the script
 // outside the AJAX/PHP templates.
 // ZONE|Location|point-forecast-URL  (separated by | characters
"AZZ023|North Phoenix Arizona|http://forecast.weather.gov/MapClick.php?lat=33.65463772160771&lon=-112.02896118164062&site=psr&smap=1&unit=0&lg=en&FcstType=text&TextType=2",
"AZZ023|Phoenix Arizona|http://forecast.weather.gov/MapClick.php?lat=33.44993&lon=-112.07221984863281&unit=0&lg=english&FcstType=text&TextType=2",
"AZZ023| Chandler Arizona|http://forecast.weather.gov/MapClick.php?lat=33.30773&lon=-111.84700012207031&unit=0&lg=english&FcstType=text&TextType=2",
"AZZ023|Gilbert Arizona|http://forecast.weather.gov/MapClick.php?lat=33.33462&lon=-111.77249908447266&unit=0&lg=english&FcstType=text&TextType=2",
"AZZ023|Glendale Arizona|http://forecast.weather.gov/MapClick.php?lat=33.57016&lon=-112.20268249511719&unit=0&lg=english&FcstType=text&TextType=2",
"AZZ023|Scottsdale Arizona|http://forecast.weather.gov/MapClick.php?lat=33.69022&lon=-111.89781188964844&unit=0&lg=english&FcstType=text&TextType=2",
"AZZ023|Tempe Arizona|http://forecast.weather.gov/MapClick.php?lat=33.40802&lon=-111.9393539428711&unit=0&lg=english&FcstType=text&TextType=2",
"AZZ028|Casa Grande Arizona|http://forecast.weather.gov/MapClick.php?lat=32.8795&lon=-111.7573&unit=0&lg=english&FcstType=text&TextType=2",
"AZZ015|Flagstaff Arizona|http://forecast.weather.gov/MapClick.php?lat=35.1981&lon=-111.6513&unit=0&lg=english&FcstType=text&TextType=2",
"AZZ027|Gila Bend Arizona|http://forecast.weather.gov/MapClick.php?lat=32.9478&lon=-112.7168&unit=0&lg=english&FcstType=text&TextType=2",
"AZZ023|Maricopa Arizona|http://forecast.weather.gov/MapClick.php?lat=33.0581&lon=-112.0476&unit=0&lg=english&FcstType=text&TextType=2",
"AZZ037|Prescott Arizona|http://forecast.weather.gov/MapClick.php?lat=34.54&lon=-112.4685&unit=0&lg=english&FcstType=text&TextType=2",
"AZZ013|Pinetop Arizona|http://forecast.weather.gov/MapClick.php?lat=34.1259&lon=-109.9376&unit=0&lg=english&FcstType=text&TextType=2",
"AZZ038|Sedona Arizona|http://forecast.weather.gov/MapClick.php?lat=34.8697&lon=-111.761&unit=0&lg=english&FcstType=text&TextType=2",
"AZZ504|Tucson Arizona|http://forecast.weather.gov/MapClick.php?lat=32.21662&lon=-110.88724136352539&unit=0&lg=english&FcstType=text&TextType=2",
"AZZ504| Tucson Foothills Arizona|http://forecast.weather.gov/MapClick.php?lat=32.289&lon=-110.8469&unit=0&lg=english&FcstType=text&TextType=2",
"AZZ025|Yuma Arizona|http://forecast.weather.gov/MapClick.php?lat=32.7253&lon=-114.6244&unit=0&lg=english&FcstType=text&TextType=2",
"CAZ513|San Jose California|http://forecast.weather.gov/MapClick.php?CityName=San+Jose&state=CA&site=MTR&textField1=37.3394&textField2=-121.894&e=0&TextType=2",
"CAZ513|Saratoga California|http://forecast.weather.gov/MapClick.php?CityName=Saratoga&state=CA&site=MTR&textField1=37.2639&textField2=-122.022&e=1&TextType=2",
"HIZ009|Kaneohe Hawaii|http://forecast.weather.gov/MapClick.php?CityName=Kaneohe&state=HI&site=HFO&textField1=21.4111&textField2=-157.792&TextType=2"
);
//*/


Jeanette
"Some dreams are in the night time, And some seem like yesterday
But leaves turn brown and fade, Ships sail away
You long to say a thousand words…but Seasons Change."



CWOP:CW3794, MesoWest: C3794, Facebook: https://www.facebook.com/PepperRidgeNorthValleyWX/

 

anything