Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4017) - 17 March 2024

Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014 (a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

Updated advforecast2.php (JSON) V5.11 handles NWS API change

Discussion of Ken True's web site templates

Moderator: saratogaWX

Post Reply
User avatar
saratogaWX
Posts: 1170
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Updated advforecast2.php (JSON) V5.11 handles NWS API change

Post by saratogaWX »

With the announcement of the NWS on 29-Apr-2019 that the api.weather.gov was deprecating the forecast queries for points/ and removing the current 302 redirect to a gridpoint forecast, the underlying method of using the API had to change in the script.

Now, the specified point's meta-data is fetched first (from cache if available, otherwise fetched from API and cached) and the gridpoint forecast is used directly (based on the meta-data content). The prior caching method (in ./cache/forecast-URLcache.txt) is no longer used (that had contained the point->gridpoint URLs).

Now the ./cache/forecast-{zone}-{N}-json-meta.txt file contains all the relevant data about the specified point that was derived from multiple API fetches re: point, Zone, WFO and saved.

If you're using the V5.10 script, please update before 24-Jun-2019 when the NWS will turn off the 302 redirect for the point forecast and that version of the script will likely fail to work properly.

Standalone update: use the script page for download.
Saratoga Template(USA): use the update tool page with query Base-USA, Plugin-*, 30-Apr-2019
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Updated advforecast2.php (JSON) V5.11 handles NWS API change

Post by beteljuice »

I really don't know how you've stayed on top of all the changes in nearly all of your 'fetch' scripts the last year !

I'd have given up and moved to a hole in the ground long since :?

Truly monumental work :clap: :clap: :clap: :clap: :clap: :clap: :clap:
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
saratogaWX
Posts: 1170
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: Updated advforecast2.php (JSON) V5.11 handles NWS API change

Post by saratogaWX »

Thanks for the kind words!!

It has been a challenge, especially with the NOAA / NWS sites switching awkwardly to HTTPS, and the long-delayed conversion of weather.gov to a new format. :bash: :evil:

Sometimes, I hear the hole in the ground whispering softly to me... but, I'm not quite dead yet. :ugeek:
jlmr731
Posts: 225
Joined: Sat 27 Aug 2016 12:11 am
Weather Station: Davis vantage pro 2
Operating System: Debian
Location: Wickliffe, Ohio
Contact:

Re: Updated advforecast2.php (JSON) V5.11 handles NWS API change

Post by jlmr731 »

And I just updated it yesterday. Now knowing our Government ill wait till mid june to update cause poor Ken will be up to v5.18 by then :lol:

Thank you so much Ken.
Post Reply