Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
144 views
in Technique[技术] by (71.8m points)

ios - Google Weather API gone?

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

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?

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!

Question&Answers:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...