WXforum.net

Web Weather => Weather Website PHP/AJAX scripting => Topic started by: SLOweather on January 22, 2018, 06:32:24 PM

Title: WU API Almanac JSON Script, It's already here!
Post by: SLOweather on January 22, 2018, 06:32:24 PM
Well, heck. You can't beat WxForum and good ol' Saratoga Ken!

I had the VWS almanac data of highs/lows/averages on my site for years. As y'all might know, that connection is broken, so I took it off. After yet another query about it today, I went a'searching WU for their API info. In short, here's what I need.

http://api.wunderground.com/api/MyAPIkey/almanac/q/CA/San_Luis_Obispo.json

which returns

Quote
response   
version   "0.1"
termsofService   "http://www.wunderground.com/weather/api/d/terms.html"
features   
almanac   1
almanac   
airport_code   "KSBP"
temp_high   
normal   
F   "63"
C   "17"
record   
F   "82"
C   "27"
recordyear   "2014"
temp_low   
normal   
F   "42"
C   "5"
record   
F   "30"
C   "-1"
recordyear   "2007"

Now I need to parse it. Did a search here and found this thread from 2012...

www.wxforum.net/index.php?topic=15427

So, now, to keep within the 20 calls /day developer limit, I need to mash that up into something I can call from a cron job just after midnight and write to a table I can display.

Thanks, Ken, and the OP, CNYWeather!
Title: Re: WU API Almanac JSON Script, It's already here!
Post by: saratogaWX on January 22, 2018, 07:27:29 PM
 8-)  I love code that stands the test of time (2012-2017.. not bad)
Title: Re: WU API Almanac JSON Script, It's already here!
Post by: jgillett on January 23, 2018, 11:13:36 AM
It's a shame NWS doesn't stand that same test of time...  :roll: