雅虎天气,雅虎GeoPlant,谷歌天气或其他API来使用JavaScript连接?雅虎、天气、或其他、GeoPlant

2023-09-10 20:14:46 作者:㈠命为红颜╮

我需要一种方式来获得一定的城市与JavaScript当前的天气回来?哪个API,我会更好地使用?还是有,你可以使用Ajax请求来获得当前的天气任何其他应用程序?

I need a way to get the current weather back for a certain city with javascript? Which API would I be better to use? Or are there any other apps that you can use an ajax request to get the current weather?

GeoPlanit需要一个AppID,所以我没有尝试这样做又和雅虎的天气是一个RSS feed。我也看到了谷歌的天气API不支持在这个阶段?

GeoPlanit required an appid so I haven't tried this yet and yahoo weather is an RSS feed. I have also read that Google's weather API is unsupported at this stage?

感谢。

编辑:也找不到任何将JSON格式返回数据,这是最近的事情,我发现,但只允许拉链codeS - http://services.badbamboo.com/REST/Common.ashx?method=GetWeather&zip=80202&jsoncallback=_cb

Also can't find anything that will return data in JSON format, this is the closest thing I found but it only allows zip codes -- http://services.badbamboo.com/REST/Common.ashx?method=GetWeather&zip=80202&jsoncallback=_cb

推荐答案

您可以解析从雅虎的RSS提要的JavaScript。另请参见:http://stackoverflow.com/questions/507441/best-weather-apis

You could parse the RSS feed from Yahoo with JavaScript. Also see: http://stackoverflow.com/questions/507441/best-weather-apis

仅供参考,这是相当琐碎写一个脚本来获取天气在服务器端。

FYI, it's quite trivial to write a script to fetch the weather on the server side.