如何获取某个地点的天气预报?

发布于 2025-01-07 18:14:21 字数 235 浏览 2 评论 0原文

我想要获取当前位置的天气预报(未来 5 天的天气预报)。

我对 iOS 的天气 API(如 Yahoo、Google、Weather.com...)进行了研究。但是我无法找到使用天气 API(带有预测)的示例项目

如果有<示例项目或任何在我的应用程序中使用的免费天气预报服务。 请告诉我

提前谢谢你。

I want to get weather report (forecast for the next 5 days) of the current location.

I did a research about weather APIs for iOS like Yahoo, Google, Weather.com .... But I was unable to find an example project which uses weather API (with forecasting)

If there is any example project or any free weather report services to use in my application.
Please tell me

Thank u in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

山人契 2025-01-14 18:14:21

这个想法很简单..你必须寻找API,向其传递所需的参数日期范围-国家/地区等....这将返回一个xml缓冲区..然后你可以使用和目标c XML 解析器 .. 尝试用 google parse xml Objective c 搜索一下,你会发现很多文章。

这是一个旧 SOF 主题的 API (http://stackoverflow.com/questions/5775488/to-display-weather-forecast-for-currentday-next-day-and-day-after-next-day-in -ip)。

NOAA REST Interface

Example: http://www.weather.gov/forecasts/xml/sample_products/browser_interface/ndfdXMLclient.php?zipCodeList=90210&product=time-series&begin=2004-01-01T00:00:00&end=2013-04-21T00:00:00&maxt=maxt&mint=mint

Yahoo! Weather Forecast RSS

Example: http://weather.yahooapis.com/forecastrss?p=90210

Google Weather API - documentation URL for this?

Example: http://www.google.com/ig/api?weather=90210

Weather Underground API

Example: http://api.wunderground.com/auto/wui/geo/GeoLookupXML/index.xml?query=90210

Weather Channel - Requires signup

Example: found sample code at github. Ruby gem for accessing the Weather Channel XML API

WeatherAPI (Norway)

Example: http://api.yr.no/weatherapi/locationforecast/1.6/?lat=34;lon=-118

The idea is so simple .. you have to look for the API , pass it the required parameters Date range - country etc .. .. this will return an xml buffer .. then you can use and objective c XML parser .. Try to google parse xml objective c and you'll find a lot of articles .

Here's a sort of APIs form an old SOF topic (http://stackoverflow.com/questions/5775488/to-display-weather-forecast-for-currentday-next-day-and-day-after-next-day-in-ip).

NOAA REST Interface

Example: http://www.weather.gov/forecasts/xml/sample_products/browser_interface/ndfdXMLclient.php?zipCodeList=90210&product=time-series&begin=2004-01-01T00:00:00&end=2013-04-21T00:00:00&maxt=maxt&mint=mint

Yahoo! Weather Forecast RSS

Example: http://weather.yahooapis.com/forecastrss?p=90210

Google Weather API - documentation URL for this?

Example: http://www.google.com/ig/api?weather=90210

Weather Underground API

Example: http://api.wunderground.com/auto/wui/geo/GeoLookupXML/index.xml?query=90210

Weather Channel - Requires signup

Example: found sample code at github. Ruby gem for accessing the Weather Channel XML API

WeatherAPI (Norway)

Example: http://api.yr.no/weatherapi/locationforecast/1.6/?lat=34;lon=-118
云巢 2025-01-14 18:14:21

也许您可以查看 Apple 的天气小部件,看看您是否可以观察该小部件如何与weather.yahoo.com 进行通信,或者只是通过 WebKit 或其他方式使用它。它位于 /Library/Widget/Weather.wdgt

Perhaps you could look at Apple's weather widget and see if you can observe how the widget communicates with weather.yahoo.com or just use it through WebKit or something. It's in /Library/Widget/Weather.wdgt

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文