Author |
|
Handman Senior Member
Joined: February 02 2009 Location: United States
Online Status: Offline Posts: 229
|
Posted: December 10 2014 at 12:52 | IP Logged
|
|
|
I am just wondering whether anyone has been able to load rainfall totals (24 hrs for example) to load into PH. I would like to adjust my landscape irrigation schedule based on rainfall amounts, but after reading many posts, it seems like some macros no longer work, URL scrapers don't scrape, etc. Is there a reasonable way to load daily rainfall totals into PH as a global variable? (or otherwise) If I get 1/2" of rain here in California, I can delay all my watering for at least a week depending on the temps.
|
Back to Top |
|
|
dhoward Admin Group
Joined: June 29 2001 Location: United States
Online Status: Offline Posts: 4447
|
Posted: December 10 2014 at 20:08 | IP Logged
|
|
|
Handman,
Probably the best way is to sign up for a free API developer account at weatherunderground.com. This will give you a unique key that you don't want to give out to anyone. With that setup, then I would just use the URLScraper as detailed on this post (3/4 way down on page): http://power-home.com/forum/forum_posts.asp?TID=835&KW=weath erunderground&PN=0&TPN=1.
Just change the URL to match the URL to access your API version. Mine looks like this (ID has been changed to garbage): http://api.wunderground.com/api/XX83kdkk3jjeujmdje/condition s/q/FL/Apopka.json
This gives me data that looks like this:
{
"response": {
"version":"0.1",
"termsofService":"http://www.wunderground.com/weather/api/d/ terms.html",
"features": {
"conditions": 1
}
}
, "current_observation": {
"image": {
"url":"http://icons.wxug.com/graphics/wu2/logo_130x80.png",
"title":"Weather Underground",
"link":"http://www.wunderground.com"
},
"display_location": {
"full":"Apopka, FL",
"city":"Apopka",
"state":"FL",
"state_name":"Florida",
"country":"US",
"country_iso3166":"US",
"zip":"32703",
"magic":"1",
"wmo":"99999",
"latitude":"28.66349983",
"longitude":"-81.52464294",
"elevation":"23.00000000"
},
"observation_location": {
"full":"RCACF, Apopka, Florida",
"city":"RCACF, Apopka",
"state":"Florida",
"country":"US",
"country_iso3166":"US",
"latitude":"28.640276",
"longitude":"-81.512688",
"elevation":"72 ft"
},
"estimated": {
},
"station_id":"KFLAPOPK27",
"observation_time":"Last Updated on December 10, 9:00 PM EST",
"observation_time_rfc822":"Wed, 10 Dec 2014 21:00:27 -0500",
"observation_epoch":"1418263227",
"local_time_rfc822":"Wed, 10 Dec 2014 21:00:44 -0500",
"local_epoch":"1418263244",
"local_tz_short":"EST",
"local_tz_long":"America/New_York",
"local_tz_offset":"-0500",
"weather":"Clear",
"temperature_string":"49.6 F (9.8 C)",
"temp_f":49.6,
"temp_c":9.8,
"relative_humidity":"87%",
"wind_string":"From the WSW at 2.7 MPH Gusting to 4.9 MPH",
"wind_dir":"WSW",
"wind_degrees":247,
"wind_mph":2.7,
"wind_gust_mph":"4.9",
"wind_kph":4.3,
"wind_gust_kph":"7.9",
"pressure_mb":"1020",
"pressure_in":"30.12",
"pressure_trend":"0",
"dewpoint_string":"46 F (8 C)",
"dewpoint_f":46,
"dewpoint_c":8,
"heat_index_string":"NA",
"heat_index_f":"NA",
"heat_index_c":"NA",
"windchill_string":"50 F (10 C)",
"windchill_f":"50",
"windchill_c":"10",
"feelslike_string":"50 F (10 C)",
"feelslike_f":"50",
"feelslike_c":"10",
"visibility_mi":"10.0",
"visibility_km":"16.1",
"solarradiation":"0",
"UV":"0","precip_1hr_string":"0.00 in ( 0 mm)",
"precip_1hr_in":"0.00",
"precip_1hr_metric":" 0",
"precip_today_string":"0.00 in (0 mm)",
"precip_today_in":"0.00",
"precip_today_metric":"0",
"icon":"clear",
"icon_url":"http://icons.wxug.com/i/c/k/nt_clear.gif",
"forecast_url":"http://www.wunderground.com/US/FL/Apopka.htm l",
"history_url":"http://www.wunderground.com/weatherstation/WX DailyHistory.asp?ID=KFLAPOPK27",
"ob_url":"http://www.wunderground.com/cgi-bin/findweather/ge tForecast?query=28.640276,-81.512688",
"nowcast":""
}
}
Very easy to scrape data in this format.
Dave.
|
Back to Top |
|
|
|
|