如何按位置获取雅虎的woeid? [英] How to get Yahoo's woeid by location?

查看:26
本文介绍了如何按位置获取雅虎的woeid?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

// 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;
            }

我之前使用过这个API,它工作正常,但是从今天开始它返回一个错误,HttpStatus.SC_OK 不正常.此 API 是否已关闭?谢谢.

I used this API and it work ok before, but It return a error since today, the HttpStatus.SC_OK is not OK. Has this API been closed? Thanks.

推荐答案

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

Yes, it's closed, give a look here: http://soup.metwit.com/post/47181933854/an-alternative-to-yahoo-weather-api

这篇关于如何按位置获取雅虎的woeid?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆