根据雅虎!必须提供Weather API文档,WOEID才能获取特定区域的天气信息.可以使用Yahoo!获得WOEID.GeoPlanet服务.
如果我有邮政编码,这是两个API调用以获取天气信息.
从邮政编码
获取WOEID:http://where.yahooapis.com/v1/places.q(19146)?appid = ...
使用WOEID获取天气信息:http://weather.yahooapis.com/forecastrss ?W = 12765532
但是,经过一些网页抓取后,我发现你可以通过一次API调用完成同样的事情:
http://xml.weather.yahoo.com/forecastrss?p=19146
我找不到任何关于此的文件.在生产应用中使用是否安全?
the api documentation says:
Note: The old location parameter 'p' has been deprecated and will be removed in the future releases. Hence users are encouraged to migrate to the 'w' parameter which provides deep integration into Y! GeoPlanet. The old documentation is archived here.
so: using p doesn't seem to be the best idea for production code to me.
| 归档时间: |
|
| 查看次数: |
4833 次 |
| 最近记录: |