Author Topic: Heads-up USA alerts.weather.gov is changing.. script updates are required.  (Read 2278 times)

0 Members and 1 Guest are viewing this topic.

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9298
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
The NWS has said:
Quote
NWS Common Alerting Protocol (CAP) Users,

This is a friendly reminder that NWS CAP v1.1 is being terminated. NWS supports and continues production of CAP v1.2. Please see the following two links for the latest announcements. I've also provided a brief summary below each link.
 
NWS Alerts Atomic Syndication Format (ATOM) Data Changes: Effective on or about January 31, 2024
Describes NWS transition of the NWS Alerts ATOM feed on or about January 31, 2024 to utilizing CAP 1.2 data provided by the NWS API at api.weather.gov.  Users that pull data from alerts.weather.gov via tools such as curl or wget may need to make changes to ensure continuity of service. 

alerts.weather.gov Version 2.3.0 Upgrade: Effective on or about February 14, 2024
Describes NWS implementation of a new version of alerts.weather.gov on or about February 14, 2024, at which time, the dissemination by NWS of products formatted with CAP v1.1 will be terminated.  As a result, the user interface at alerts.weather.gov will be updated and will begin using the CAP 1.2 formatted data provided by the NWS Application Programming Interface (API) at api.weather.gov.

This requires changes to nws-alerts.php, atom-advisory.php (and deprecation of atom-top-warning.php) scripts to use the revised formats.  It is NOT just a simple URL change in the existing scripts as the format of the alert messages has changed (expecially for a 'no alerts' condition).

I'll have updates for nws-alerts.php and atom-advisory.php posted on my site Jan 31, 2024 and on the template update tool.
The nws-alerts.php github distribution will also be updated then.

So.. if you wonder why your NWS alerts aren't working.. do check for updates to the scripts first :)

Best regards,
Ken
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 saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9298
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Ok, the update is ready on the update tool for Saratoga templates and also in the standalone GitHub distribution.

In the Base-USA distribution, I've removed atom-advisory.php and atom-top-warning.php as those scripts are now deprecated in favor of the nws-alerts.php V2.00 script set.  That required changes to wxindex.php and wxadvisory.php.
Two less things for me to try and maintain.

check-fetch-times.php V1.55 was updated to indicate the two script's deprecation, and a small check on a php setting needed to enable language switching in Canada and World distributions.
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 saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9298
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
And.. they've started the transition.  The NCEP Status messages said
Quote
SENIOR DUTY METEOROLOGIST NWS ADMINISTRATIVE MESSAGE
NWS NCEP CENTRAL OPERATIONS COLLEGE PARK MD
1332Z TUE JAN 30 2024


The 12Z NAM began and is running on time with 13 Alaskan...25
Canadian...63 CONUS...0 Mexican...and 9 Caribbean raobs available
for ingest.


12Z NAM RAOB RECAP...
72206/JAX - No report
70398/ANN - 10144...Power failure
72214/TAE - 10148...Ascent not authorized for this period
72261/DRT - 10142...Ground equipment failure
72797/UIL - 10142...Ground equipment failure
91376/MAJ - 10158...Flight equipment failure



SCHEDULED TRAFFIC REDIRECTS OF ALERTS TOMORROW AT 1500Z...
On Wednesday January 31st at 1500Z, NCO will be redirecting a
portion of traffic from alerts.weather.gov to api.weather.gov. A
further description of the change can be viewed at
https://www.weather.gov/media/notification/pdf_2023_24/scn23-122_atom_feed_transition.pdf.
As always, operational issues for
alerts.weather.gov and api.weather.gov should be reported to
NCO's Tech Control at nco.ops@noaa.gov.





Ready/SDM/NCO/NCEP

So UPDATE YOUR SCRIPTS if you want to keep your Base-USA template working with current NWS alerts.
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 Vasco

  • Forecaster
  • *****
  • Posts: 343
    • PWS
Quote
The 12Z NAM began and is running on time with 13 Alaskan...25
Canadian...63 CONUS...0 Mexican...and 9 Caribbean raobs available
for ingest.

Bon appetit  :)

« Last Edit: January 31, 2024, 06:25:42 PM by Vasco »
Ecowitt GW1102 (with GW2000) + Weather Display in Windows 10

Offline mikeym2m

  • Senior Contributor
  • ****
  • Posts: 153
    • MikeyM's Thornhurst PA Weather
Re: Heads-up USA alerts.weather.gov is changing.. script updates are required.
« Reply #4 on: February 02, 2024, 01:56:35 PM »
Thanks Ken!

MikeyM

Offline spweather

  • Contributor
  • ***
  • Posts: 130
    • Sand Point Weather
Re: Heads-up USA alerts.weather.gov is changing.. script updates are required.
« Reply #5 on: February 09, 2024, 07:35:20 PM »
Thank you, Ken.

Dennis
Regards,
Dennis

- Davis Wireless Vantage Pro2 Plus w/24hr FARS
- Davis (Ultra)Sonic Anemometer
- Boltek/MicroLDN TOA Lightening Detection
- Porcupine Labs LR4/Fluke 414D Laser Rangefinder snow depth measuring sensor


Offline ValentineWeather

  • Forecaster
  • *****
  • Posts: 6377
    • Valentine Nebraska's Real-Time Weather
Re: Heads-up USA alerts.weather.gov is changing.. script updates are required.
« Reply #6 on: February 10, 2024, 08:12:18 AM »
Not playing well with the latest advisory. I let the North Platte, FSO know. The front page advisory on website says Saturday expires 3:45 pm. It originally said Saturday 6 pm then they reissued after I called them, and it changed to Saturday 3:45 pm.  It doesn't actually expire until Sunday, 5 am.


 [ You are not allowed to view attachments ]
 [ You are not allowed to view attachments ]

« Last Edit: February 10, 2024, 08:14:41 AM by ValentineWeather »
Randy

Offline ValentineWeather

  • Forecaster
  • *****
  • Posts: 6377
    • Valentine Nebraska's Real-Time Weather
Re: Heads-up USA alerts.weather.gov is changing.. script updates are required.
« Reply #7 on: February 10, 2024, 08:27:12 AM »
It's fixed. I called again, and the advisory got reissued. 
 [ You are not allowed to view attachments ]

 
Randy

Offline rrrick8

  • Senior Contributor
  • ****
  • Posts: 238
    • Vermilion weather
Re: Heads-up USA alerts.weather.gov is changing.. script updates are required.
« Reply #8 on: February 16, 2024, 09:08:42 AM »
So I finally lost my old script yesterday here in Central Illinois and after installing new NWS-Alerts.php in my stand-alone version, I get nothing but an error of "Parse error: syntax error, unexpected 'else' (T_ELSE) in /home/nwawlqmy/public_html/nws-alerts.php on line 361"

Are other pages required to be changed in the stand-alone as well?
Severe Weather Manager-Vermilion County EMA
CWOP-CW9931 KILDANVI5

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9298
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Heads-up USA alerts.weather.gov is changing.. script updates are required.
« Reply #9 on: February 16, 2024, 09:48:16 AM »
You can pick up that script (and any others that have recently changed) in the https://github.com/ktrue/NWS-alerts github distribution.  I've not tested the standalone version, but nws-alerts.php shouldn't have any PHP errata in it.  What is the URL to the nws-alerts.php script on your site?
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 rrrick8

  • Senior Contributor
  • ****
  • Posts: 238
    • Vermilion weather
Re: Heads-up USA alerts.weather.gov is changing.. script updates are required.
« Reply #10 on: February 16, 2024, 10:00:09 AM »
You can pick up that script (and any others that have recently changed) in the https://github.com/ktrue/NWS-alerts github distribution.  I've not tested the standalone version, but nws-alerts.php shouldn't have any PHP errata in it.  What is the URL to the nws-alerts.php script on your site?

 Got it from github.  https://vermilionweather.com/nws-alerts.php
Severe Weather Manager-Vermilion County EMA
CWOP-CW9931 KILDANVI5

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9298
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Heads-up USA alerts.weather.gov is changing.. script updates are required.
« Reply #11 on: February 16, 2024, 10:12:30 AM »
Please .zip up the script and post it here.. I'll take a look.
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 rrrick8

  • Senior Contributor
  • ****
  • Posts: 238
    • Vermilion weather
Re: Heads-up USA alerts.weather.gov is changing.. script updates are required.
« Reply #12 on: February 16, 2024, 10:56:58 AM »
Please .zip up the script and post it here.. I'll take a look.


 [ You are not allowed to view attachments ]
Severe Weather Manager-Vermilion County EMA
CWOP-CW9931 KILDANVI5

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9298
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Heads-up USA alerts.weather.gov is changing.. script updates are required.
« Reply #13 on: February 16, 2024, 11:16:23 AM »
I've done a compare of your nws-alerts v.s. nws-alerts on GitHub and found a bunch of old XML code in your version.
I suggest you download nws-alerts.php from the GitHub distribution and try it (without customization) first, then apply any customization you wish.
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 rrrick8

  • Senior Contributor
  • ****
  • Posts: 238
    • Vermilion weather
Re: Heads-up USA alerts.weather.gov is changing.. script updates are required.
« Reply #14 on: February 16, 2024, 11:40:23 AM »
That's what I thought I did. Installed it with no customization. But I will check it again when I get back home in an hour or so.
Severe Weather Manager-Vermilion County EMA
CWOP-CW9931 KILDANVI5

Offline rrrick8

  • Senior Contributor
  • ****
  • Posts: 238
    • Vermilion weather
Re: Heads-up USA alerts.weather.gov is changing.. script updates are required.
« Reply #15 on: February 16, 2024, 01:30:41 PM »
Redownloaded nws-alerts.php from github and installed on server but get same error.
https://vermilionweather.com/nws-alerts.php
This is from the gibhub zip file...
 [ You are not allowed to view attachments ]
Severe Weather Manager-Vermilion County EMA
CWOP-CW9931 KILDANVI5

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9298
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Heads-up USA alerts.weather.gov is changing.. script updates are required.
« Reply #16 on: February 16, 2024, 02:04:03 PM »
The contents of the .zip are correct and match the distributed version in the templates exactly.
Since you're not running a Saratoga template, the check-fetch-times.php diagnostic script is not available to use to help diagnosis.

What version of PHP are you running on the site?
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 rrrick8

  • Senior Contributor
  • ****
  • Posts: 238
    • Vermilion weather
Re: Heads-up USA alerts.weather.gov is changing.. script updates are required.
« Reply #17 on: February 16, 2024, 02:14:46 PM »
The contents of the .zip are correct and match the distributed version in the templates exactly.
Since you're not running a Saratoga template, the check-fetch-times.php diagnostic script is not available to use to help diagnosis.

What version of PHP are you running on the site?

7.4.33
Severe Weather Manager-Vermilion County EMA
CWOP-CW9931 KILDANVI5

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9298
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Heads-up USA alerts.weather.gov is changing.. script updates are required.
« Reply #18 on: February 16, 2024, 02:24:31 PM »
Should work fine in PHP 7.4 also.  I'm using PHP 8.1.

Grrr... the
Quote
Parse error: syntax error, unexpected 'else' (T_ELSE) in /home/nwawlqmy/public_html/nws-alerts.php on line 327
is in the second line in
Code: [Select]
if($doDebug) {$noted .= "<!-- \$czR alert: \n".var_export($czR,true)."\n -->\n\n";}
      (isset($czR->note)) ? $note = trim($czR->note) : $note = '';                                            //     get the note
and Curly's construct (<test>?<true>:<false>; instead of if (<test>) {<true>} else {<false>} ) has been ok since PHP 5.  I'm at a loss on what to do.  Parse errors prevent external viewing via ?sce=view of the source so I can't externally confirm that is the line of code where the fatal error happens.
When you download (via FTP/SCP) the nws-alerts.php file, what is shown in lines 326-327?
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 rrrick8

  • Senior Contributor
  • ****
  • Posts: 238
    • Vermilion weather
Re: Heads-up USA alerts.weather.gov is changing.. script updates are required.
« Reply #19 on: February 16, 2024, 02:25:17 PM »
Error I get seems like it doesn't like the double "else".

 [ You are not allowed to view attachments ]
Severe Weather Manager-Vermilion County EMA
CWOP-CW9931 KILDANVI5

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9298
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Heads-up USA alerts.weather.gov is changing.. script updates are required.
« Reply #20 on: February 16, 2024, 02:36:21 PM »
Not surprising.. that's not the current code in nws-alerts.php V2.00

Try updating your website with the nws-alerts.php from NWS-alerts-master.zip (which does have the current copy).
« Last Edit: February 16, 2024, 02:38:34 PM by saratogaWX »
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 rrrick8

  • Senior Contributor
  • ****
  • Posts: 238
    • Vermilion weather
Re: Heads-up USA alerts.weather.gov is changing.. script updates are required.
« Reply #21 on: February 16, 2024, 02:52:59 PM »
Not surprising.. that's not the current code in nws-alerts.php V2.00

Try updating your website with the nws-alerts.php from NWS-alerts-master.zip (which does have the current copy).

That was it! Thanks Ken. You don't get enough credit for all that you do to keep us enthusiasts going.
Like Dustin Hoffman told Andy Garcia in the movie HERO, "You can keep the credit, I'm more of a cash sort of guy".
I just donated again for the cause and urge others on here to do so as well.
Much appreciated,
Rick
« Last Edit: February 16, 2024, 02:56:57 PM by rrrick8 »
Severe Weather Manager-Vermilion County EMA
CWOP-CW9931 KILDANVI5

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9298
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Heads-up USA alerts.weather.gov is changing.. script updates are required.
« Reply #22 on: February 16, 2024, 02:59:53 PM »
Thanks very much, Rick.  I'm glad I could help diagnose the issue.
Best regards,
Ken
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 mkutche

  • Forecaster
  • *****
  • Posts: 1043
    • GosportWx.com
Re: Heads-up USA alerts.weather.gov is changing.. script updates are required.
« Reply #23 on: February 18, 2024, 07:09:55 PM »
I recently updated the USA alerts script and it worked yesterday but seems to not want to work today.. there's a special weather statement for my area and it's not showing

https://gosportwx.com/wxadvisory.php

https://www.weather.gov/ind/

Mike
Mike K.
Davis Vantage Vue 6250 - CumulusMX (3.21.1-b3205)
Gosport, Indiana
Gosportwx.com twitter.com/GosportINWX
-----------------------------------------------------------

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9298
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Heads-up USA alerts.weather.gov is changing.. script updates are required.
« Reply #24 on: February 18, 2024, 07:20:31 PM »
You can use https://alerts.weather.gov/search?zone=ssZnnn or ssCnnn to check if there's an alert posted for the specific forecast or county zone

Your Settings.php shows
Quote
$SITE['NWSalertsCodes'] = array(
"Owen Co.|INZ053|INC119|",
);

Checking both those shows the API has no current alerts for them.  Keep in mind that 'Special Weather Statement' may not appear in the api, but does show (oddly enough) in the forecast.weather.gov for your location.
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