Author Topic: WU-History now works with WU/TMC API...  (Read 6448 times)

0 Members and 1 Guest are viewing this topic.

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 7615
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: WU-History now works with WU/TMC API...
« Reply #150 on: September 09, 2019, 01:40:56 PM »
I think I've found the fix for 'today' daily data.  The problem is that there are two different queries to the API that result in 'today' data.

The general 'day' query of form:
Code: [Select]
https://api.weather.com/v2/pws/history/all?stationId='.$WUID.'&format=json&units='.$WCunits.'&date='.$lookFor.'&apiKey='.$WCAPIkey.'&numericPrecision=decimal and a 'rapid today' query using
Code: [Select]
https://api.weather.com/v2/pws/observations/all/1day?stationId='.$WUID.'&format=json&units='.$WCunits. '&apiKey='.$WCAPIkey.'&numericPrecision=decimal
The script used the former for ALL day queries.  Now it will use the latter for TODAY queries and that seems to have fixed the data current issue for today's data.

WXDailyHistory.php Version 1.32 - 09-Sep-2019 is now available at https://github.com/ktrue/WU-history
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline dasman

  • Forecaster
  • *****
  • Posts: 467
    • Wx Peotone
Re: WU-History now works with WU/TMC API...
« Reply #151 on: September 09, 2019, 05:24:28 PM »
Ken i have updated and todays data seems good. However i only have partial data for September 2nd, 3rd, 4th, 5th, and 8th. Is this data recoverable?
Dave Sommerfed
Peotone Illinois USA
CW7762, KILPEOT1
NWS COOP, CoCoRaHS, Spotter Network

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 7615
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: WU-History now works with WU/TMC API...
« Reply #152 on: September 09, 2019, 05:34:24 PM »
Yes, you can reload the cache by adding ?force=1 to the URL like:

WXDailyHistory.php?graphspan=day&year=2019&month=09&day=02&force=1 (for the 2nd) .. etc.

It will use the daily history URL and should force fetch of that data again.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline dasman

  • Forecaster
  • *****
  • Posts: 467
    • Wx Peotone
Re: WU-History now works with WU/TMC API...
« Reply #153 on: September 09, 2019, 06:42:40 PM »
Thanks Ken that worked. After checking i found that over 40 days dating back to May 1st were missing data. I have forced them all. Oddly there are 6 days i cant force, July 5th thru 10th. Nothing shows when i try to force those dates.
Dave Sommerfed
Peotone Illinois USA
CW7762, KILPEOT1
NWS COOP, CoCoRaHS, Spotter Network

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 7615
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: WU-History now works with WU/TMC API...
« Reply #154 on: September 09, 2019, 07:35:58 PM »
Yep.. the July dates were a global issue.. the API didn't get data from the collectors then.  It's missing for me too.

My daily (and monthly) data for July, 2019 is missing for 1,3-6, and 8.  The query gets a return code of 204 (Data not available)
The rest of July is ok.
« Last Edit: September 09, 2019, 08:10:39 PM by saratogaWX »
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline AWL

  • Forecaster
  • *****
  • Posts: 677
    • Ardmore Weather Live
Re: WU-History now works with WU/TMC API...
« Reply #155 on: September 10, 2019, 11:17:43 AM »
Everything working great now! Really want to thank you for all your hard work. Don't know what the personal weather website world would do without you  =D> =D>


Doug