Page 1 of 1

api.weather.gov format changed again??

Posted: Thu Feb 22, 2018 2:57 am
by N0BGS
Hi All:

Anyone one else having trouble getting the NWS point forecasts?

https://www.kpw3.com/wxforecast.php

Seems to have been broken for several days now.

--Kurt

Re: api.weather.gov format changed again??

Posted: Thu Feb 22, 2018 4:15 am
by saratogaWX
The api hasn’t changed, just the data loading to the api server has become more unreliable.

Download https://Saratoga-weather.org/advforecas ... p?sce=view as advforecast2.php and replace your V5 script with the old (but still working) V4.02 version.

Re: api.weather.gov format changed again??

Posted: Thu Feb 22, 2018 5:22 am
by N0BGS
Thanks, Ken but apparently it's unhappy with line 699 in ver 4.02 PHP7 thing perhaps?

"Warning: strpos(): Offset not contained in string in /var/www/html/advforecast2.php on line 699"

Line 699:

Code: Select all

$start = strpos($html, '<td colspan="2" valign="top" align="left">',$startgrab+1); // need second one

--K

Re: api.weather.gov format changed again??

Posted: Thu Feb 22, 2018 5:37 am
by N0BGS
OK, my mistake. :roll:

The script is making HTTP calls from my SSL-enabled site. I changed the appropriate lines in the script from http to https and all seems to be well.

Thanks again.

--Kurt