xcode 谷歌天气 API 没了?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12145820/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 01:20:58  来源:igfitidea点击:

Google Weather API gone?

iosxcodeweatherweather-apigoogle-weather-api

提问by Sam B

I had been using the following google weather api in my iPhone apps to get 4 day weather forecast.

我一直在我的 iPhone 应用程序中使用以下谷歌天气 api 来获取 4 天的天气预报。

NSString *address = @"http://www.google.com/ig/api?weather=Chicago";
    NSString *request = [NSString stringWithFormat:@"%@",address];

    NSLog(@"request: %@", request);

    NSURL *URL = [NSURL URLWithString:request];
    NSError *error;
    NSString *XML = [NSString stringWithContentsOfURL:URL encoding:NSASCIIStringEncoding error:&error];

    NSLog(@"XML: %@", XML);
    NSLog(@"XML lenght: %d", [XML length]);

As of yesterday Aug 25th, 2012 I get absolutely nothing back! I don't get any results back. When did this happen? Did Has anyone else experience this same problem?

截至昨天 2012 年 8 月 25 日,我完全没有得到任何回报!我没有得到任何结果。这是什么时候的事儿?有没有其他人遇到过同样的问题?

This is a really critical issue as I have multiple weather / clock apps that look for google weather api and they all are crashing as I expect some results back in my XML string!

这是一个非常关键的问题,因为我有多个天气/时钟应用程序在寻找 google 天气 api 并且它们都崩溃了,因为我希望在我的 XML 字符串中返回一些结果!

回答by

The Google Weather API seems to be "officially" dead, which is ironic to say, because it was never officially a supported API to begin with. There has been no official announcement from Google, but it should be noted that iGoogle is now using Wunderground's API for weather data.

谷歌天气 API 似乎“正式”死了,说起来很讽刺,因为它从来没有被正式支持过。谷歌没有官方公告,但应该注意的是,iGoogle 现在正在使用 Wunderground 的 API 来获取天气数据。

http://igoogle.wunderground.com/US/CA/Mountain_View.html

http://igoogle.wunderground.com/US/CA/Mountain_View.html

So no, you're not seeing things. The Google Weather API is gone. I experienced the same thing. It's time to move on and find a suitable replacement.

所以不,你看不到东西。Google Weather API 不见了。我经历了同样的事情。是时候继续前进并找到合适的替代品了。

回答by Sam B

If anyone is interested in getting XML that looked and felt like google weather api then use this MSN weather API list of conditions?

如果有人对获得看起来和感觉像谷歌天气 API 的 XML 感兴趣,那么使用这个MSN 天气 API 条件列表?

回答by sakher

Google stopped their weather API, i found another one from the website yr.noand i use it in my website weathercase.netvia PHP which is wonderful

谷歌停止了他们的天气 API,我从yr.no网站找到了另一个,我通过 PHP在我的网站weathercase.net 中使用它,这很棒

回答by John Slegers

The Google weather API was shut down in 2012.

Google 天气 API 于 2012 年关闭。

If you're looking for an alternative to the google weather API, these are the three most popular weather APIs at the moment :

如果您正在寻找谷歌天气 API 的替代品,以下是目前最流行的三个天气 API:

Check their respective documentation pages for more info on how to use them!

查看它们各自的文档页面以获取有关如何使用它们的更多信息!

回答by Bronislava

From this time Weather Underground API and Dark Sky API were shut down too. Although Dark Sky API is still working until 2021, we have to look for a replacement. I hope that OpenWeather with their new One Call APIwill help anyone who needs powerful weather API at this moment.

从此时起,Weather Underground API 和 Dark Sky API 也被关闭。虽然Dark Sky API 一直工作到 2021 年,但我们必须寻找替代品。我希望 OpenWeather 及其新的One Call API能够帮助目前需要强大天气 API 的任何人。