如何从Yahoo Weather API获得3、5或7天的预报,而不仅仅是今天和明天?
http://weather.yahooapis.com/forecastrss?w=location给出了今天和明天的天气预报。
我们如何才能在响应中获得更多的预测?
谢谢,
发布于 2011-09-29 19:45:24
正如API explanation上所述,只有两个参数:WOEID的w (地球上的id)和单位的u (华氏度或摄氏度)。没有要获取的天数的参数。
我建议切换到功能更多的some other weather API。
发布于 2016-08-24 14:56:56
Limit参数工作正常:
select item.forecast from weather.forecast where woeid in
(select woeid from geo.places(1) where text="munic, de") and u='c' limit 3和URL:
https://query.yahooapis.com/v1/public/yql?q=select%20item.forecast%20from%20weather.forecast%20where%20woeid%20in%20(select%20woeid%20from%20geo.places(1)%20where%20text%3D%22munic%2C%20de%22)%20and%20u%3D%27c%27%20limit%203&format=json发布于 2012-09-20 23:48:19
更新:它不再工作了,
这要容易得多。只需将参数&d=5添加到字符串中,如下所示:
http://weather.yahooapis.com/forecastjson?w=24549429&u=c&d=5 如果你想要5天的话。对于RSS版本,将json更改为rss。
https://stackoverflow.com/questions/7399422
复制相似问题