WXforum.net

Web Weather => Weather Website PHP/AJAX scripting => Topic started by: dasman on February 07, 2018, 05:48:48 PM

Title: More NWS forecast script issues.
Post by: dasman on February 07, 2018, 05:48:48 PM
My NWS forecast script has been going haywire all day. 1st it was "stale" data from a few days ago. Then it was the zone forecast (again from a few days ago. Now i get nothing! You can view it on my main page ar www.peotoneweather.com (http://www.peotoneweather.com) and at http://peotoneweather.com/nwsforecast.php (http://peotoneweather.com/nwsforecast.php)
 I know that it usually means there are national weather service issues with their server, however I checked a couple other personal weather stations near me and their point forecasts seemed to be working.
Title: Re: More NWS forecast script issues.
Post by: saratogaWX on February 07, 2018, 06:01:47 PM
It does seem that the api.weather.gov contents go flakey and stale (Zone forecasts) more frequently now.

Revert to advforecast2.php V4.02 here (https://saratoga-weather.org/advforecast2-V4.02.zip) if you like (and still have the mapclick point-printable forecast URLs in your Settings.php).  That venerable script scrapes the production forecast.weather.gov site and does not use the API.. it also uses different cache names and so is compatible with the newer 5.02 JSON script.
Title: Re: More NWS forecast script issues.
Post by: dasman on February 07, 2018, 06:11:11 PM
Thanks Ken. When I get home from work tonight I will switch the script back.
Title: Re: More NWS forecast script issues.
Post by: dasman on February 07, 2018, 10:51:23 PM
I have changed to the older version of the script. The zone forecast is showing. However I'm still showing 2 errors on my main page.(http://www.peotoneweather.com/images/error.png).
Title: Re: More NWS forecast script issues.
Post by: dasman on February 08, 2018, 12:00:18 AM
For now I have turned error reporting off to get rid of the mess!
Title: Re: More NWS forecast script issues.
Post by: saratogaWX on February 08, 2018, 11:48:55 AM
It may be the coding on your index.php page.. the V4.02 script returns fewer icons (like the current weather.gov site) than the API returned with the 5.02 script.  If you hard-coded it for 10 icons, you should change it to use a upper limit of count($forecasticons)-1 instead.
Title: Re: More NWS forecast script issues.
Post by: dasman on February 08, 2018, 12:15:30 PM
Thanks Ken!
Title: Re: More NWS forecast script issues.
Post by: 92merc on February 08, 2018, 02:49:31 PM
When all the others were reporting issues about a month ago, my site was fine.  Starting yesterday afternoon, I started getting the approx signs and less than signs with temps.  It also resorted to Zone casts by end of day.

I flipped back to V4 this morning.   I'll have to manually load the V5 page off/on and see if they get it fixed again.
Title: Re: More NWS forecast script issues.
Post by: saratogaWX on February 08, 2018, 04:23:52 PM
The approximate/less than/greater than signs are displayed when a Zone forecast is parsed (in both 4.02 and 5.02 scripts) -- the NWS text-only forecast is parsed for words describing the temperature range/values and conditions description, since the Zone forecast does not include icon/detailed temperature items.

With all the turmoil about stale/nonsensical forecasts available with api.weather.gov lately, it's wise to downgrade to the older script (4.02).