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

4

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.

Marchall answered 1/1, 2010 at 20:8 Comment(1)
The US Nat Weather Svc REST api for the forecast data: weather.gov/forecasts/xml/rest.php Here's REST api for current observations: weather.gov/xml/current_obsMarchall
T
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.)

Topeka answered 12/1, 2010 at 0:7 Comment(1)
This looks great, thank you. I think I'll add a simple memcache layer above it since NWS only updates data every 60 min.Marchall
A
3

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

Allantois answered 1/1, 2010 at 20:21 Comment(0)
T
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.)

Topeka answered 12/1, 2010 at 0:7 Comment(1)
This looks great, thank you. I think I'll add a simple memcache layer above it since NWS only updates data every 60 min.Marchall
A
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?

Arela answered 2/1, 2010 at 8:36 Comment(0)
C
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.

Clownery answered 2/1, 2010 at 13:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.