7

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.

Larry K
  • 47,808
  • 15
  • 87
  • 140
  • 1
    The US Nat Weather Svc REST api for the forecast data: http://www.weather.gov/forecasts/xml/rest.php Here's REST api for current observations: http://www.weather.gov/xml/current_obs/ – Larry K Jan 03 '10 at 20:33

4 Answers4

3

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

AndyG
  • 39,700
  • 8
  • 109
  • 143
draegtun
  • 22,441
  • 5
  • 48
  • 71
3

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
  • 844
  • 9
  • 6
  • 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 Jan 12 '10 at 16:24
2

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
  • 129,424
  • 31
  • 207
  • 592
0

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 Summers
  • 2,139
  • 3
  • 27
  • 57