Author Topic: advforecast2.php  (Read 1562 times)

0 Members and 1 Guest are viewing this topic.

Offline ValentineWeather

  • Forecaster
  • *****
  • Posts: 6364
    • Valentine Nebraska's Real-Time Weather
Re: advforecast2.php
« Reply #25 on: May 25, 2018, 09:01:24 AM »
I was getting these issues zone only with 5.07 long time ago and was forced to go back with 4.xx . Apparently not all offices are the same.
Randy

Offline miraculon

  • Sunrise Side Weather
  • Forecaster
  • *****
  • Posts: 4107
  • KE8DAF
    • Sunrise Side Weather in Rogers City MI USA
Re: advforecast2.php
« Reply #26 on: May 25, 2018, 09:52:44 AM »
I got just a blank forecast with the dropdown box with 4.05. I went back to 5.07 for now, where the zone still works.
NWS whack-a-mole strikes again...

Greg H.


Blitzortung Stations #706 and #1682
CoCoRaHS: MI-PI-1
CWOP: CW4114 and KE8DAF-13
WU: KMIROGER7
Amateur Radio Callsign: KE8DAF

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: advforecast2.php
« Reply #27 on: May 25, 2018, 12:32:49 PM »
Ok, got the issue fixed.

The cause was a change in how they populate the "geometry" entry.. sometimes it's a string, sometimes an array.

I've rewritten the code for determining whether to use a point or a zone forecast to look for an "icon" in the spec (if present, it's a point forecast, if absent, it's a zone forecast).

advforecast2.php V5.08 (JSON) is now available at the usual haunts:

Standalone:  https://saratoga-weather.org/scripts-carterlake.php
Template: https://saratoga-weather.org/wxtemplates/updates.php with query for Base-USA, Plugin-*, 25-May-2018

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 n7xrd

  • Forecaster
  • *****
  • Posts: 366
    • Kamiah Weather
Re: advforecast2.php
« Reply #28 on: May 25, 2018, 12:37:28 PM »
 :grin:  Great job Ken Thank Sir!!

Offline Jasiu

  • Forecaster
  • *****
  • Posts: 947
    • LexMAWeather
Re: advforecast2.php
« Reply #29 on: May 25, 2018, 01:02:33 PM »
Success!  Thanks, Ken!
https://lexmaweather.info
On Mastodon: @LexMAWeather@toot.community

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: advforecast2.php
« Reply #30 on: May 25, 2018, 01:11:55 PM »
Apparently, APIs are not immune to change as much as I'd hoped...

The root cause of the problems was due to a change in how the api included the "geometry" entry, and I'd used that entry to choose to do a point or zone process.   Recently, they changed from providing a string (or null string) to a string or a null array.. D'Oh.  bad form to switch variable types in the API, and so PHP rightly griped about trying a string function on an array.

The V5.08 change now uses the presence of an "icon" entry in the first forecast period.. if there, it's processed as a point forecast.  If missing, then the zone forecast process is run instead.  This is the method I should have used anyway.  Live and learn...
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 zeppline

  • Senior Member
  • **
  • Posts: 66
    • Las Vegas Weather Guy
Re: advforecast2.php
« Reply #31 on: May 25, 2018, 03:33:49 PM »
Thanks Ken works for me.

Offline mikeym2m

  • Senior Contributor
  • ****
  • Posts: 153
    • MikeyM's Thornhurst PA Weather
Re: advforecast2.php
« Reply #32 on: May 25, 2018, 03:43:18 PM »
Thanks Ken

Working for me!

 :grin:

Cheers

MikeyM

Offline gwwilk

  • Southeast Lincoln Weather
  • Forecaster
  • *****
  • Posts: 2578
    • SouthEast Lincoln, NE Weather
Re: advforecast2.php
« Reply #33 on: May 25, 2018, 04:05:33 PM »
Thanks, Ken!  Working here as well. :grin:
Regards, Jerry Wilkins
gwwilk@gmail.com

Offline spweather

  • Contributor
  • ***
  • Posts: 130
    • Sand Point Weather
Re: advforecast2.php
« Reply #34 on: May 25, 2018, 05:16:48 PM »
Thanks Ken.
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 miraculon

  • Sunrise Side Weather
  • Forecaster
  • *****
  • Posts: 4107
  • KE8DAF
    • Sunrise Side Weather in Rogers City MI USA
Re: advforecast2.php
« Reply #35 on: May 26, 2018, 07:11:35 PM »
I just got back from an overnight trip across the state, and saw this. I did the update and it worked for me as well.

Thanks again, Ken for all you do for us.

Greg H.


Blitzortung Stations #706 and #1682
CoCoRaHS: MI-PI-1
CWOP: CW4114 and KE8DAF-13
WU: KMIROGER7
Amateur Radio Callsign: KE8DAF

 

anything