views:

201

answers:

5

Hi,

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.

+3  A: 

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

/I3az/

draegtun
A: 

Have a look at http://codewordstudios.com/posts/2-introducing-weatherman-a-ruby-gem. It does not use the National Weather Service though.

Warren Noronha
+1  A: 

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?

brian d foy
A: 

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.

Mike
+1  A: 

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

cobra libre
This looks great, thank you. I think I'll add a simple memcache layer above it since NWS only updates data every 60 min.
Larry K