如何通过位置获得雅虎的阵营?

her*_*rtD 7 yahoo weather geolocation

// Get woeid by lati/long
            HttpGet hg = new HttpGet(
                        "http://where.yahooapis.com/geocode?location=" + latlon + "&flags=J&gflags=R)");
            HttpClient hc = new DefaultHttpClient();
            HttpResponse weatherHR = hc.execute(hg);

            if (weatherHR.getStatusLine().getStatusCode() != HttpStatus.SC_OK) {
                if (DEBUG)
                    Utils.log("", "Location != HttpStatus.SC_OK");
                return null;
            }
Run Code Online (Sandbox Code Playgroud)

我使用过这个API,之前它运行正常,但是从今天起它返回错误,HttpStatus.SC_OK不行.该API已关闭吗?谢谢.

Cas*_*Cas 10

雅虎已转向名为BOSS的付费服务,但他们确实提供非商业服务:

Yahoo Geo API的非商业用途

雅虎 继续完全支持在非商业环境中构建在Placefinder和PlaceSpotter之上的开发人员应用程序.这两种服务都可以通过YQL使用,每个表的速率限制为2000个查询.了解有关使用Placefinder和Placespotter YQL表的更多信息.

使用Placefinder,您可以反向查找纬度和经度:

http://developer.yahoo.com/yql/console/?q=select%20*%20from%20geo.placefinder%20where%20text%3D%2237.416275%2C-122.025092%22%20and%20gflags%3D%22R%22

可以转换为json请求:

http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20geo.placefinder%20where%20text%3D%2237.416275%2C-122.025092%22%20and%20gflags%3D%22R%22&format=json

  • 现在它根本不起作用了 (3认同)

bed*_*dre 6

是的,它关闭了,看看这里:http: //soup.metwit.com/post/47181933854/an-alternative-to-yahoo-weather-api

  • 雅虎 天气API在2013年4月3日是DEAD. (3认同)