开发者

Is there a Ruby client for the US National Weather Service data?

开发者 https://www.devze.com 2022-12-15 10:12 出处:网络
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?

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 b开发者_JAVA技巧e helpful. They provide a Perl example. I'd use it as a guide for writing the Ruby version.


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.)


There is a Perl CPAN module called Weather-NWS which uses the NDFD.


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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消