Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rb_wunderground

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rb_wunderground

  • 0.1.2
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

RbWunderground

A simple wrapper for the Weather Underground API that returns a Hashie::Mash for convenience.

TODO: Write more tests

Installation

Add this line to your application's Gemfile:

gem 'rb_wunderground'

And then execute:

$ bundle

Or install it yourself as:

$ gem install rb_wunderground

Usage

To get started, create a new instance of RbWunderground::Base with your Weather Underground API key.

w = RbWundergound::Base.new('API_KEY')

The following is available through the Weather Underground's JSON API:

alerts
almanac
astronomy
conditions
currenthurricaine
forecast
forecast10day
geolookup
history_YYYMMDD
hourly
hourly10day
planner_MMDDMMDD
rawtide
tide
webcams
yesterday

These queries are available as methods with a location passed to each in a format accepted by Weather Underground and return a Hashie::Mash of the JSON results.

w = RbWundergound::Base.new('API_KEY')
# Location by Zip Code
forecast = w.forecast('12207')
# Location by US State and City
forecast = w.forecast('NY/Albany')
# Location by Country and City
forecast = w.forecast('England/London')
# Location by airport code
forecast = w.forecast('KALB')
# Historical info for a date
history = w.history('12207')

rb_wunderground also supports multiple queries in a single method call - just string together multiple features with 'and'. For example:

w = RbWundergound::Base.new('API_KEY')
# Get forecast and hourly forecast for a zip code
forecast = w.forecast_and_hourly('12186')
# Get hourly forecast and weather yesterday along with current conditions for a US city
forecast = w.hourly_and_yesterday_and_conditions("NY/Albany")

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

FAQs

Package last updated on 16 Dec 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc