如何根据位置获得雅虎的诡计? [英] How to get Yahoo's woeid by location?
本文介绍了如何根据位置获得雅虎的诡计?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
// 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
这篇关于如何根据位置获得雅虎的诡计?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文