美国国家气象局数据有 Ruby 客户端吗?
唯一可免费用于商业用途的美国天气数据是美国国家气象局。我想用它。是否有用于访问它的 Ruby/Rails 库?
Perl 也会有帮助。他们提供了 Perl 示例。我会用它作为编写 Ruby 版本的指南。
The only US weather data that is available free for commercial use is the US National Weather Service. I'd like to use it. Is there a Ruby/Rails library for accessing it?
Perl would also be helpful. They provide a Perl example. I'd use it as a guide for writing the Ruby version.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
除了 SOAP 服务之外,NWS 还提供 RESTful Web 服务,但是如果您的需求很简单,请考虑 github 上的 outoftime-noaa gem。它提供了一个简单的界面来获取预测和当前状况数据。
(请注意,它的依赖项之一尚未与 Ruby 1.9 兼容。)
The NWS provides a RESTful web service in addition to the SOAP service, but if your needs are simple, consider the outoftime-noaa gem on github. It provides a straightforward interface for obtaining forecast and current conditions data.
(Be warned that one of its dependencies is not yet compatible with Ruby 1.9.)
有一个 Perl CPAN 模块,名为
Weather-NWS
使用 NDFD。There is a Perl CPAN module called
Weather-NWS
which uses the NDFD.NDFD 是一项基于 SOAP 的 Web 服务。只需使用 Ruby SOAP 客户端向其发送正确的信息并处理响应即可。您对使用 Ruby 中的 SOAP 有疑问吗?
The NDFD is a SOAP-based web service. Just use a Ruby SOAP client to send it the right information and handle the response. Did you have a question about using SOAP from Ruby?
这取决于你想做什么。
如果您只想要一个或两个位置的小部件,那么 SOAP 接口就可以了。
如果您需要大量数据(或多个位置),那么 NOAA 希望您下载原始数据 grib2 数据(更新)每小时。一个简单的批处理作业就可以做到这一点。
It depends on what you're wanting to do.
If you just want a widget for a location or two the SOAP interface is fine.
If you want a large amount of data (or many locations) then NOAA wants you to download the raw grib2 data (updated) hourly. A simple batch job works for that.