从 Yahoo WOEID 获取时区
我正在使用这个问题(yahoo-weather-api-woeid-retrieval)进行转换美国 ZIP 到 Yahoo WOEID 值。然而,虽然雅虎回复返回了各种有趣的内容,但我感兴趣的是获取该位置的正确时区。
有没有简单的方法可以从 Yahoo 返回时区,或者将 WOEID(或 ZIP)映射到时区值?
作为后退,如果我获得美国 WOEID 的天气预报,该数据包括预报时的当地时间和时区(即返回 EDT、PDT HST 等)。所以我可以从那里抓取数据,但我更愿意将其与位置数据更多地关联起来。一个例子是:
<yweather:condition text="Cloudy" code="26" temp="72" date="Tue, 26 Oct 2010 11:03 am EDT" />
I am using this question (yahoo-weather-api-woeid-retrieval) to convert a US ZIP to a Yahoo WOEID value. However while the Yahoo reply returns all sorts of interesting stuff, what I am interested in getting is the correct timezone of the location.
Is there any easy way to return the timezone from Yahoo, or map a WOEID (or ZIP in that matter) to a timezone value?
As a fall back if I get a weather forecast of a US WOEID, that data includes the local time with timezone at the time of the forecast (ie it returns EDT, PDT HST etc). So I can scrape the data from there, but I would prefer to associate it more with the location data. An example of this is:
<yweather:condition text="Cloudy" code="26" temp="72" date="Tue, 26 Oct 2010 11:03 am EDT" />
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不相信你想要的功能被暴露了。我见过的例子是这样做的(PHP):
来源:http://www .phpclasses.org/browse/file/22382.html(需要免费注册)
显然这不使用 Yahoo API,但它非常轻量级...
I don't believe the functionality you want is exposed. The examples I've seen do something like this (PHP):
Source: http://www.phpclasses.org/browse/file/22382.html (Free registration req'd)
Obviously this doesn't use the Yahoo API but it is pretty lightweight...
这个问题可以帮助您获取邮政编码的时区。 这个答案可能也会有所帮助。
This question could help you getting the timezone for a zipcode. This answer might also help.