Author Topic: NOAA ATOM/CAP Top Advisory Warning PHP script problem  (Read 1319 times)

0 Members and 1 Guest are viewing this topic.

Offline xmas111

  • Senior Member
  • **
  • Posts: 65
    • http://www.johnsweather.com
NOAA ATOM/CAP Top Advisory Warning PHP script problem
« on: September 11, 2023, 08:35:30 AM »
I updated to the latest NOAA ATOM/CAP Top Advisory Warning PHP script, 12/22.

Now when I click on the warning it takes to the next page but with no information.

Not sure what I did wrong but I'd appreciate any help with it.

Here's the link to my page.....I don't know how long the warning will be there, if it goes away I'll bump this thread the next time a warning show up.

johnsweather.com

Thanks,
John

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9288
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: NOAA ATOM/CAP Top Advisory Warning PHP script problem
« Reply #1 on: September 11, 2023, 10:09:39 AM »
On your wxadvisory.php page do you have
Code: [Select]
<?php
$includeOnly 
true;
$DefaultZone "MAZ019";
$doSummary false;
include_once(
"atom-advisory.php");
?>

I notice that you have both atom-advisory and atom-top-warning installed on the wxadvisory.php page.. you should only use one or the other.

Also.. the better script set to use is the nws-alerts set of scripts (replaces the function of atom-advisory and atom-top-warning scripts and allows multiple zones to be monitored).  It's distributed built-in the Base-USA saratoga template and available for non-Saratoga use on GitHub https://github.com/ktrue/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 xmas111

  • Senior Member
  • **
  • Posts: 65
    • http://www.johnsweather.com
Re: NOAA ATOM/CAP Top Advisory Warning PHP script problem
« Reply #2 on: September 11, 2023, 11:46:31 AM »
Looks like I picked the wrong script. I was using "atom-top-warning"  instead of the atom-advisory"

Downloaded the right one and everything works now.

Thanks.

Offline andro700

  • Chuck
  • Forecaster
  • *****
  • Posts: 420
    • Gobles Weather Page
Re: NOAA ATOM/CAP Top Advisory Warning PHP script problem
« Reply #3 on: December 01, 2023, 12:42:06 PM »
My advisories page and my main page are not showing advisories. All have done is update scripts and that is it. Currently we have a flood watch in effect. I see it hasn't updated for a while. Actually since May 15th. I am using nws-alerts-config, nws-alerts-summary.

https://www.goblesweather.com/index.php
https://www.goblesweather.com/wxadvisory.php

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9288
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: NOAA ATOM/CAP Top Advisory Warning PHP script problem
« Reply #4 on: December 01, 2023, 05:13:45 PM »
First issue is your Settings.php has
Code: [Select]
$SITE['NWSforecasts']   = array( // for the advforecast2.php V3.xx version script
// use "Zone|Location|Point-printableURL",  as entries .. first one will be the default forecast.
 "WAC033|Renton|https://forecast.weather.gov/MapClick.php?lat=47.462&lon=-122.2015&unit=0&lg=english&FcstType=text&TextType=2",
"WAC033|Kent|https://forecast.weather.gov/MapClick.php?lat=47.3811&lon=-122.234&unit=0&lg=english&FcstType=text&TextType=2",
"WAC033|Tukwila|https://forecast.weather.gov/MapClick.php?lat=47.4626&lon=-122.256&unit=0&lg=english&FcstType=text&TextType=2",
"WAC033|Bellevue|https://forecast.weather.gov/MapClick.php?lat=47.61&lon=-122.1879&unit=0&lg=english&FcstType=text&TextType=2",
"WAC033|Seattle|https://forecast.weather.gov/MapClick.php?lat=47.6036&lon=-122.3294&unit=0&lg=english&FcstType=text&TextType=2",
"WAC033|North Bend|https://forecast.weather.gov/MapClick.php?lat=47.4935&lon=-121.7831&unit=0&lg=english&FcstType=text&TextType=2",
"WAC053|Tacoma|https://forecast.weather.gov/MapClick.php?lat=47.2551&lon=-122.4416&unit=0&lg=english&FcstType=text&TextType=2",
"WAC033|Bothell|https://forecast.weather.gov/MapClick.php?lat=47.7621&lon=-122.2031&unit=0&lg=english&FcstType=text&TextType=2",
"WAC061|Everett|https://forecast.weather.gov/MapClick.php?lat=47.9766&lon=-122.206&unit=0&lg=english&FcstType=text&TextType=2",
"WAC073|Bellingham|https://forecast.weather.gov/MapClick.php?lat=48.7524&lon=-122.4712&unit=0&lg=english&FcstType=text&TextType=2",
"WAC067|Olympia|https://forecast.weather.gov/MapClick.php?lat=47.0493&lon=-122.8676&unit=0&lg=english&FcstType=text&TextType=2",
"WAC009|Port Angeles|https://forecast.weather.gov/MapClick.php?lat=48.1187&lon=-123.4313&unit=0&lg=english&FcstType=text&TextType=2",
);
ALL those WACnnn values are incorrect.. they are County Zones, not Forecast Zones WAZnnn -- you need to respecify those with the correct forecast zones.

In your Settings,php you have
Code: [Select]
$SITE['NWSalertsCodes'] = array(
  "King County|WAZ558|WAC033",
  "Snohomish County|WAZ556|WAC061",
  "Pierce County|WAZ509|WAC053",
  "Kitsap County|WAZ559|WAC035",
  "Skagit County|WAZ506|WAC057",
  "Whatcom County|WAZ567|WAC073",
  "Clallam County|WAZ653|WAC009",
  "Jefferson County|WAZ513|WAC031",                               
//  "San Francisco|CAZ006|CAC075"
);
and since there are more than 4 unique zones, I'm assuming you have a cron job to run nws-alerts.php regularly.  If you do/did -- check to make sure it is still running correctly -- that could be the reason why the alerts aren't showing up.

I ran the script manually via browser, and it has refreshed your site.. looks like the cron job to run it is not actually running.

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 andro700

  • Chuck
  • Forecaster
  • *****
  • Posts: 420
    • Gobles Weather Page
Re: NOAA ATOM/CAP Top Advisory Warning PHP script problem
« Reply #5 on: December 03, 2023, 12:48:11 PM »
Here are the two pages I have where I got the codes from.

https://alerts.weather.gov/cap/wa.php?x=3
https://alerts.weather.gov/cap/wa.php?x=2

Chuck

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9288
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: NOAA ATOM/CAP Top Advisory Warning PHP script problem
« Reply #6 on: December 03, 2023, 03:40:09 PM »
Those are the good links.. it's just you must use the Forecast Zone (not the County Zone) in the $SITE['NWSforecasts']   = array();

The Forecast Zones are used for Zone forecast fallback when the Point forecast isn't available .. the County Zones do NOT have a Zone forecast at all.

Have you checked to see that the cron job for nws-alerts is running correctly?
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 andro700

  • Chuck
  • Forecaster
  • *****
  • Posts: 420
    • Gobles Weather Page
Re: NOAA ATOM/CAP Top Advisory Warning PHP script problem
« Reply #7 on: December 03, 2023, 05:41:19 PM »
I just checked my page it shows it updated at 230pm. So what zone numbers do I use then.

Chuck


Sent from my iPhone using Tapatalk

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9288
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: NOAA ATOM/CAP Top Advisory Warning PHP script problem
« Reply #8 on: December 03, 2023, 05:50:00 PM »
So there are two separate issues.  for wxforecast.php (the forecast script) these entries in Settings.php with WACnnn County Zones need to use WAZnnn Forecast zones
Code: [Select]
$SITE['NWSforecasts']   = array( // for the advforecast2.php V3.xx version script
// use "Zone|Location|Point-printableURL",  as entries .. first one will be the default forecast.
 "WAC033|Renton|https://forecast.weather.gov/MapClick.php?lat=47.462&lon=-122.2015&unit=0&lg=english&FcstType=text&TextType=2",
"WAC033|Kent|https://forecast.weather.gov/MapClick.php?lat=47.3811&lon=-122.234&unit=0&lg=english&FcstType=text&TextType=2",
"WAC033|Tukwila|https://forecast.weather.gov/MapClick.php?lat=47.4626&lon=-122.256&unit=0&lg=english&FcstType=text&TextType=2",
"WAC033|Bellevue|https://forecast.weather.gov/MapClick.php?lat=47.61&lon=-122.1879&unit=0&lg=english&FcstType=text&TextType=2",
"WAC033|Seattle|https://forecast.weather.gov/MapClick.php?lat=47.6036&lon=-122.3294&unit=0&lg=english&FcstType=text&TextType=2",
"WAC033|North Bend|https://forecast.weather.gov/MapClick.php?lat=47.4935&lon=-121.7831&unit=0&lg=english&FcstType=text&TextType=2",
"WAC053|Tacoma|https://forecast.weather.gov/MapClick.php?lat=47.2551&lon=-122.4416&unit=0&lg=english&FcstType=text&TextType=2",
"WAC033|Bothell|https://forecast.weather.gov/MapClick.php?lat=47.7621&lon=-122.2031&unit=0&lg=english&FcstType=text&TextType=2",
"WAC061|Everett|https://forecast.weather.gov/MapClick.php?lat=47.9766&lon=-122.206&unit=0&lg=english&FcstType=text&TextType=2",
"WAC073|Bellingham|https://forecast.weather.gov/MapClick.php?lat=48.7524&lon=-122.4712&unit=0&lg=english&FcstType=text&TextType=2",
"WAC067|Olympia|https://forecast.weather.gov/MapClick.php?lat=47.0493&lon=-122.8676&unit=0&lg=english&FcstType=text&TextType=2",
"WAC009|Port Angeles|https://forecast.weather.gov/MapClick.php?lat=48.1187&lon=-123.4313&unit=0&lg=english&FcstType=text&TextType=2",
);

The advisories shown on your home page and in wxadvisory.php are all controlled by this Settings.php entry
Code: [Select]
$SITE['NWSalertsCodes'] = array(
  "King County|WAZ558|WAC033",
  "Snohomish County|WAZ556|WAC061",
  "Pierce County|WAZ509|WAC053",
  "Kitsap County|WAZ559|WAC035",
  "Skagit County|WAZ506|WAC057",
  "Whatcom County|WAZ567|WAC073",
  "Clallam County|WAZ653|WAC009",
  "Jefferson County|WAZ513|WAC031",                               
//  "San Francisco|CAZ006|CAC075"
);
$SITE['NWSalertsSidebar'] = true; // =true to insert in menubar, =false no insert to menubar
//
and those correctly use both Forecast and County zones (as it should).  Any lack of current advisorys would be the result of a failure of cron to run your nws-alerts.php script (which generates all those warnings).
As they appear to be current, you don't have an advisory issue to fix, only a forecast issue to fix.
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

 

anything