Примечание: этот API устарел в Yahoo, и не будет работать !
Существует недокументированный API погоды Yahoo, который я обнаружил после возникакое-то время.Вот пример ссылки:
http://weather.yahooapis.com/forecastjson?w=12844782&u=c
Значение после w
- это WOEID, а u
- для единиц.Я уверен, что есть еще варианты для настройки URL.
Вот как это выглядит:
{
"units":{
"temperature":"C",
"speed":"km\/h",
"distance":"km",
"pressure":"mb"
},
"location":{
"location_id":"ITXX0024",
"city":"Como",
"state_abbreviation":"*",
"country_abbreviation":"IT",
"elevation":935,
"latitude":45.81000000000000,
"longitude":9.08000000000000
},
"wind":{
"speed":5.00000000000000,
"direction":"VAR"
},
"atmosphere":{
"humidity":"40",
"visibility":9.99000000000000,
"pressure":982.00000000000000,
"rising":"steady"
},
"url":"http:\/\/weather.yahoo.com\/forecast\/ITXX0024.html",
"logo":"http:\/\/l.yimg.com\/a\/i\/us\/nt\/ma\/ma_nws-we_1.gif",
"astronomy":{
"sunrise":"08:01",
"sunset":"16:42"
},
"condition":{
"text":"Fair",
"code":"34",
"image":"http:\/\/l.yimg.com\/a\/i\/us\/we\/52\/34.gif",
"temperature":9.00000000000000
},
"forecast":[
{
"day":"Today",
"condition":"Mostly Clear",
"high_temperature":7.00000000000000,
"low_temperature":2.00000000000000
},
{
"day":"Tomorrow",
"condition":"Partly Cloudy",
"high_temperature":8.00000000000000,
"low_temperature":2.00000000000000
},
{
"day":"Friday",
"condition":"Sunny",
"high_temperature":8.00000000000000,
"low_temperature":3.00000000000000
},
{
"day":"Saturday",
"condition":"Mostly Sunny",
"high_temperature":7.00000000000000,
"low_temperature":1.00000000000000
},
{
"day":"Sunday",
"condition":"Sunny",
"high_temperature":8.00000000000000,
"low_temperature":1.00000000000000
}
]
}