Author Topic: Small hiccup with wxnoaaproducts.php  (Read 384 times)

0 Members and 1 Guest are viewing this topic.

Offline MackerelSky

  • Contributor
  • ***
  • Posts: 113
    • McKean County Weather, Smethport Pa.
Small hiccup with wxnoaaproducts.php
« on: January 02, 2024, 10:17:01 AM »
Hi All,
Hope everyone has a prosperous New Year.

99% of the days, I don't have a problem with my stand alone version of wxnoaaproducts.php But there are certain days when it truncates during one of the NWS discussions or HWOs. When it happened today, I wanted to track it down.

First off the link to my page https://mckeanweather.com/mwnoaa.php

If you go there today, you'll see it stops as shown in this screen grab



As you can see, it stops just after the word 'expected'

In the next grab, we'll see where the NWS Discussion has a <1", where they are expecting less than one inch of snowfall and that less than 1" is what's stopping the script.



This happens just a few times a year that I notice, but folks that stop by my site bring it to my attention and I'd like to get it fixed if I can. What can I add, and where, to stop this from happening?

Thanks in advance,
Brad
Mckean County Weather
Located on upper Marvin Creek
https://mckeanweather.com/
Davis VP2 + fars
Cumulus 1.9.4-b1092

 

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: Small hiccup with wxnoaaproducts.php
« Reply #1 on: January 02, 2024, 06:54:07 PM »
The script that's choking on '<1"' is the text parsing script that here is 'inc-show-wfo-products.php'. This is Ken True's script that I customized a little so that it would work with the selection process in 'wxnoaaproducts.php'. Ken would have a far better idea than I would regarding the cause of this intermittent problem and the fix. Sorry I can't be of more help, Brad.
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9277
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Small hiccup with wxnoaaproducts.php
« Reply #2 on: January 02, 2024, 07:07:15 PM »
The forecast-discussion.php from my site has
Code: [Select]
preg_match('|<pre[^>]*>(.*)</pre>|Usi',$html,$matches); for 'finding' the discussion text from the returned page.

You might try
Code: [Select]
preg_match('|<pre.*>(.*)</pre>|Usi',$html,$matches);instead and see if that works out better for that forecast.
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 gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: Small hiccup with wxnoaaproducts.php
« Reply #3 on: January 02, 2024, 07:23:54 PM »
Thanks, Ken.  Much appreciated.
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline MackerelSky

  • Contributor
  • ***
  • Posts: 113
    • McKean County Weather, Smethport Pa.
Re: Small hiccup with wxnoaaproducts.php
« Reply #4 on: January 03, 2024, 05:15:18 AM »
Thanks Ken,
Will make the change and see what happens the next time they use that designation.
I'll let you know if it makes a difference.
Brad
Mckean County Weather
Located on upper Marvin Creek
https://mckeanweather.com/
Davis VP2 + fars
Cumulus 1.9.4-b1092

 

Offline MackerelSky

  • Contributor
  • ***
  • Posts: 113
    • McKean County Weather, Smethport Pa.
Re: Small hiccup with wxnoaaproducts.php
« Reply #5 on: January 03, 2024, 05:18:43 AM »
Thanks for looking Jerry, I'll try Ken's fix and post back if it works.
They didn't use that <1" today of course.

Brad
Mckean County Weather
Located on upper Marvin Creek
https://mckeanweather.com/
Davis VP2 + fars
Cumulus 1.9.4-b1092