advforecast2.php help needed

I’ve been struggling to get my forecast to display correctly. I updated the advforecast2.php to the latest and its displaying the zone forecast but I’m getting the error “The detailed point forecast weather data is not currently available.The zone forecast data for MAZ012 (Southern Worcester) will be displayed until the point forecast data is again available.”

I’ve gone into view source to try and understand whats going on but no success. Also none of my other forecasts for towns in my pull down menu are working. I clearly need to change something.

Please check it out at http://www.auburnweatherlive.com/wxforecast.php

In my Settings.php
// use “Zone|Location|Point-printableURL”, as entries … first one will be the default forecast.
“MAZ012|Auburn MA|http://forecast.weather.gov/MapClick.php?CityName=Auburn&state=MA&site=BOX&textField1=42.2&textField2=-71.8333&e=1&TextType=2”,
“KHYA|Dennis MA|http://forecast.weather.gov/MapClick.php?CityName=Dennis&state=MA&site=BOX&textField1=41.7316&textField2=-70.2019&e=1&TextType=2”,
“KIZG|North Conway NH|http://forecast.weather.gov/MapClick.php?CityName=North+Conway&state=NH&site=GYX&textField1=44.0538&textField2=-71.1268&e=0&TextType=2”,
“KMWN|Mount Washington NH|http://forecast.weather.gov/MapClick.php?CityName=Mount+Washington&state=NH&site=GYX&textField1=44.2706&textField2=-71.3047&e=1&TextType=2”,
“KAQW|Savoy MA|http://forecast.weather.gov/MapClick.php?CityName=Savoy&state=MA&site=ALY&textField1=42.5677&textField2=-73.0242&e=1&TextType=2”,

might want to read this thread
https://www.wxforum.net/index.php?topic=33332.0;topicseen
i am having issues also in vancouver wa.
apparently its a nws issue.
larry

advforecast2.php V5.x uses the “beta” api.weather.gov associated with the forecast-v3.weather.gov site. Yes, the API is sometimes very flakey. Sigh.

For those not wanting to experience the API issues with the NWS beta site, please download

https://saratoga-weather.org/advforecast2-V4.02.php?sce=view

and replace your V5 copy. It’s old, but still works with the current forecast.weather.gov site (but won’t when(if?) they switch forecast.weather.gov to the new website design) – their changover has been indefinitely delayed (at 1 year and counting now).

Ken
In the earlier thread you said that the fcstscript had to be changed if reverting back to
4.02.

$SITE[‘fcstscript’] = ‘advforecast-json.php’; // USA-only NWS Forecast script
to
Code: [Select]
$SITE[‘fcstscript’] = ‘advforecast2.php’; // USA-only NWS Forecast script

After I updated to 5.04, I still have advforecast2.php in settings.
Never saw the advforecast-json.php.
Did I miss something?

Thanks
Larry

Your advforecast2.php is the V5.02 JSON version. No need to change your Settings.php, just download the script from https://saratoga-weather.org/advforecast2-V4.02.php?sce=view and save it as advforecast2.php, then upload to replace your copy.

Thanks Ken.

Thanks Ken. All set now.

Appears NWS has managed to break 4.02 as well. Two sites, different sides of the country, both broken. Sigh.

Yep, mine is broken too :roll:

and mine as well

There’s a thread on wxforum with a possible work around and the suggestion is that the NWS has switched to the new system :dontknow:

Grrr. They changed the site to force HTTPS.

So… I’ve updated the OLD advforecast2.php to V4.03 and switched to curl for doing the access.

Use: https://saratoga-weather.org/advforecast2-V4.03.php?sce=view to have the OLD script work again.

Dang 'em

Thanks Ken, back in business here :smiley:

Same here. Thanks Ken !!!

Also… if you’re using the forecast-discussion.php script, it has been updated to V1.06 too (for https to forecast.weather.gov).

https://saratoga-weather.org/scripts-NWSmisc.php

Hi Ken,

I just put 4.03 in place to deal with the changes. I changed my NOAAZone and fileName to what I was using previously, but the forecast keeps coming up for Saratoga. Looks like it’s grabbing it from the NWSforecasts array. I’ve tried a few things, but can’t get it to use my location.

This is what I’m using for the forecast link: http://forecast.weather.gov/MapClick.php?lat=44.62566&lon=-73.05152893066406&unit=0&lg=english&FcstType=text&TextType=2

I see your link specifies the city name. Will the latest version not work with the lat/lon?

More busy… I’ve updated the advforecast2.php (JSON Version) to V5.05 and it has extra code to better handle redirects and failover to zone forecasts when needed.

It really irritates me that they’ve set the API for a point forecast to ALWAYS return a 301 to a gridpoint forecast instead of just returning the JSON requested. Grrrr… I’ve enabled curl to follow one redirect, set the timeout longer (6 seconds) and handle the muddled headers returning from a curl-fetch-with-redirect. Also set the point forecast life to be 18 hrs (instead of 12) to be ‘stale’ and fail over to the zone forecast.

Hopefully these mods will make our sites more stable while the api.weather.gov is still having flaky responses.

I’ve also decided to dual post the V4.04 and V5.05 versions of the script on the script page so there will be a durable link to the old (page scraper) script while the cutover to the new forecast.weather.gov is still pending.

Template users can pick up the updates at update tool page with a query of Base-USA, Plugin-*, 27-Feb-2018

I think I’ll rest up a bit… it’s been a busy day for NWS-related changes.

Is it still possible to get the 2-line icon display? I am not familiar with what changes they made as I never had a problem with my forecasts here but I notice the new code defaults to 1 line and I am not sure where/what to change.

The advforecast2.php V4.x script only has 1 line of icons since it is a page-scraper of the point-printable forecast.

The advforecas2.php V5.x has the two lines of icons available since it uses JSON from api.weather.gov (and they produce more icons).

If you want the two lines, you’ll need to use the V5.x script…