This has been a pain in the butt for me since the beginning of my site.
Using Weather Display and the Weather Underground almanac. Unfortunately, my airport
is not listed for the "local" record high, low or the average high low. Mine on WU is KRME (Rome)
and the records and normals come from Syracuse (KSYR) which is about 50 miles away
and a world of difference as far as those temps.
Using the Weather Underground api and getting a api key from them,
I'm able to get the KRME records for this date.
http://api.wunderground.com/api/{mykeygoeshere}/almanac/q/NY/Rome.jsonIt returns:
HTTP/1.1 200 OK
X-CreationTime:
0.065
Date:
Fri, 04 May 2012 11:59:52 GMT
Content-Length:
470
Expires:
Fri, 01 Jan 1990 00:00:00 GMT
Set-Cookie:
DT=1336132792:8265:365-v3; path=/; expires=Fri, 01-Jan-2020 00:00:00 GMT; domain=.wunderground.com
Content-Type:
application/json; charset=UTF-8
Connection:
close
Server:
Apache/1.3.33 (Unix) PHP/4.4.0
Pragma:
no-cache
Cache-Control:
no-cache, must-revalidate, no-cache="Set-Cookie", private
{
"response": {
"version": "0.1",
"termsofService": "
http://www.wunderground.com/weather/api/d/terms.html",
"features": {
"almanac": 1
}
},
"almanac": {
"airport_code": "KRME",
"temp_high": {
"normal": {
"F": "63",
"C": "17"
},
"record": {
"F": "77",
"C": "25"
},
"recordyear": "1981"
},
"temp_low": {
"normal": {
"F": "35",
"C": "1"
},
"record": {
"F": "29",
"C": "-1"
},
"recordyear": "1985"
}
}
}
So, the $64,000 question is, is it possible, and how can I parse a JSON file
so that I can display it on my site within my dashboard like I used to?
Took me a while to figure out that I can actually get this data, and the API
they provide is actually really good (if you know what you're doing
)
Here's the link to that too:
http://www.wunderground.com/weather/api/d/documentation.htmlThanks!