Author Topic: advforecast wonky today  (Read 1048 times)

0 Members and 1 Guest are viewing this topic.

Offline chief-david

  • Educational Weather
  • Forecaster
  • *****
  • Posts: 2845
  • Space Academy for Educators
    • Benilde-St. Margaret's Weather
advforecast wonky today
« on: April 12, 2018, 02:14:40 PM »
My weather warnings are gone and the forecast temps have the funny waves next to them today. Should have a Winter Storm watch posted.
 
The new update at 12:15pm Thursday 4-12 is still bad.

Wondering if this has anything to do with today being the state wide tornado test day. 1:45 and 6:45.

https://rms-weather.rdale.org/weather.php
https://rms-weather.rdale.org/advforecast2.php

Lakeville weather looks OK
Minnetonka weather could not produce a page.
Looking for more to get more info.

I can change something if I need to.
« Last Edit: April 12, 2018, 02:26:12 PM by chief-david »



You can't phase me-I teach Middle School.
It's not you-It's WU.

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: advforecast wonky today
« Reply #1 on: April 12, 2018, 02:39:46 PM »
You're using the V4.03 version (page-scraper) and it's reporting
Quote
<!-- advforecast2.php (multi) - V4.03 - 27-Feb-2018 -->
<!-- NWS URL: http://forecast.weather.gov/MapClick.php?lat=45.02233988655459&lon=-93.34722518920898&site=mpx&unit=0&lg=en&FcstType=text&TextType=2 -->
<!-- zone=MNZ060 -->
<!-- replaced http with https for NWS URL='https://forecast.weather.gov/MapClick.php?lat=45.02233988655459&lon=-93.34722518920898&site=mpx&unit=0&lg=en&FcstType=text&TextType=2' -->
<!-- curl fetching 'https://forecast.weather.gov/MapClick.php?lat=45.02233988655459&lon=-93.34722518920898&site=mpx&unit=0&lg=en&FcstType=text&TextType=2' -->
<!-- HTTP stats:  RC=200
      Times: dns=0.000 conn=0.016 pxfer=0.016 total=0.016 secs -->
<!-- loading https://forecast.weather.gov/MapClick.php?lat=45.02233988655459&lon=-93.34722518920898&site=mpx&unit=0&lg=en&FcstType=text&TextType=2 - 508 bytes -->
<!-- curl fetching 'https://forecast.weather.gov/MapClick.php?zoneid=MNZ060&zflg=1' -->
<!-- HTTP stats:  RC=200
      Times: dns=0.000 conn=0.000 pxfer=0.016 total=0.016 secs -->
<!-- loading https://forecast.weather.gov/MapClick.php?zoneid=MNZ060&zflg=1 - 66970 bytes -->
<!-- unable to write cache file ./forecast-MNZ060-0.txt -->
<!-- isZone='1' -->
<!-- rawwarn length=742 start=19412 -->
<!-- warns
Array
(
   
  • => Array

        (
        )

    [1] => Array
        (
        )

    [2] => Array
        (
        )

)
 -->
  The problem is that the NWS (in their infinite wisdom) is modifying the existing text-only Zone forecast page to be modeled after their new format.   Grrr.  So the parser can extract the text, but not the warning info as the page on the NWS site has changed.

Given that they're in the process of switching the forecast.weather.gov to the new API-driven version, I really don't want to fiddle with the old script to get around that issue.  I suggest you switch to the V5.05 version of the script which uses the API, with the caveat that the API itself is still a bit flakey, but as they firm up that, it will be much more durable than the existing version.
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 chief-david

  • Educational Weather
  • Forecaster
  • *****
  • Posts: 2845
  • Space Academy for Educators
    • Benilde-St. Margaret's Weather
Re: advforecast wonky today
« Reply #2 on: April 12, 2018, 02:44:51 PM »
I think I have a 5.05 done somewhere, then went back to 4.03.
At home this week because of knee operation. But want things to be right. Big snow moving in.

We can never thank you enough for doing all of this Ken.



You can't phase me-I teach Middle School.
It's not you-It's WU.

Offline chief-david

  • Educational Weather
  • Forecaster
  • *****
  • Posts: 2845
  • Space Academy for Educators
    • Benilde-St. Margaret's Weather
Re: advforecast wonky today
« Reply #3 on: April 12, 2018, 03:06:38 PM »
Now it's back. 15 minutes after the drill is over. #-o
I am working on the set up of 5.0

then-So I can keep the files straight can I name them
advforecast.txt (4.04)
advforecast.txt (5.03)

and not have the stuff in parenthesis NOT cause problems.
« Last Edit: April 12, 2018, 03:08:53 PM by chief-david »



You can't phase me-I teach Middle School.
It's not you-It's WU.

Offline ValentineWeather

  • Forecaster
  • *****
  • Posts: 6364
    • Valentine Nebraska's Real-Time Weather
Re: advforecast wonky today
« Reply #4 on: April 12, 2018, 03:57:09 PM »

We can never thank you enough for doing all of this Ken.

Seconded that... =D&gt;
Randy

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: advforecast wonky today
« Reply #5 on: April 12, 2018, 04:51:57 PM »
Ok, I decided to update both scripts to fix two different issues:

In advforecast2.php Version 4.03, the missing warnings on zone forecasts was fixed by changing
Code: [Select]
preg_match_all('|<li><a href="([^"]+)" id="anchor-hazards">(.*)</a></li>|Uis',$rawwarn,$warns);
to

Code: [Select]
preg_match_all('|<li><a id="hazard-.*" href="([^"]+)".*>(.*)</a></li>|Uis',$rawwarn,$warns);
which is now in advforecast2.php V4.04

In advforecast2.php Version 5.05 (JSON), the update to fix a PHP Warning when no alerts are available was to change

Code: [Select]
  if (count($ALERTJSON) > 0 and isset($ALERTJSON['@graph'])) {
to
Code: [Select]
  if (is_array($ALERTJSON) and count($ALERTJSON) > 0 and isset($ALERTJSON['@graph'])) {
which is now in advforecast2.php V5.06

Both updates are now available via the script page and
for Saratoga template users via update tool page for query Base-USA, Plugin-*, 12-Apr-2018

Let's hope they leave the existing forecast.weather.gov ALONE until they swap in the new version from forecast-v3.weather.gov (then only the 5.x script will work, and the 4.x script will stop working).
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 yamiacaveman

  • Forecaster
  • *****
  • Posts: 439
    • Penn Lake Weather
Re: advforecast wonky today
« Reply #6 on: April 14, 2018, 05:17:36 PM »
Hey Chief-David,

What I have been doing -- going back and forth between version 4.03 and now 5.06 -- I load one at a time up to my server -- let's say, version 5.07 first -- after that I rename it to oldadvforecast2.php then upload version 4.03 just as is, advforecast2.php and that is the one I am going to use. So if 4.03 is not working and now I go to version 5.06 I just rename them around. Remove the Old from the 5.06 version and rename 4.03 to oldadvforecast2.php

That's my goofy solution, but this way, I already have both on the server - and the name stays the same, so that you don't have to change anything else that might be looking for the advforecast.php file.

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: advforecast wonky today
« Reply #7 on: April 14, 2018, 05:22:15 PM »
advforecast2.php V5.07 - 14-Apr-2018 was released today.  It adds two features:

1) I've added an URL cache (forecast-URLcache.txt) for the point->gridpoint forecast to skip the access to api.weather.gov for a 302 redirect they provide for a /points/ request to a /gridpoints/ request.  The URL cache file will auto-update as needed.  This saves one HTTPS access when loading a freshened forecast.
2) I've added the WFO phone and email contact info and details about the gridpoint involved to the notice box when a Zone forecast is displayed due to a point forecast not being available.  The box now contains info like
Quote
The detailed point forecast weather data is not currently available.
The zone forecast data for CAZ513 (Santa Clara Valley Including San Jose) will be displayed
until the point forecast data is again available.
If this persists, contact the NWS San Francisco Bay Area/Monterey, CA WFO
at (831) 656-1725 or email at w-mtr.webmaster@noaa.gov
to have them update the point forecast for /gridpoints/MTR/97,101 on api.weather.gov
(area in italics is added). This allows you to contact the responsible NWS field office with the details about which gridpoint forecast is failing.. hopefully this will reduce the time to get the point forecast back.  I was hesitant to include the NWS phone and email, but after checking the real weather.gov pages, they already display that info in the footer, so it is 'public'.  Be aware that calling the phone number may result in a voice-response system, and not a person, but the voice may give an additional number to call to talk with a forecaster.. use that one instead.  Emails to the address shown may take longer to resolve those stale/unavailable gridpoint forecast issues.

Standalone users download from the script page
Template users use the update tool page with a query Base-USA, Plugin-*, 14-Apr-2018

Hopefully this update will improve (a bit) the load-time for the script by eliminating one HTTPS access and help you to resolve stale point forecasts easily.

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