A Ruby object-oriented interface to the Yahoo! Weather JSON API.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin Added execution permissions to bin/test Mar 30, 2016
config/locales Version 1.0.0 Sep 6, 2013
lib Refactoring of wind direction method May 10, 2016
test Added codeclimate test reporter May 10, 2016
.codeclimate.yml Updated rubocop and codeclimate configs May 10, 2016
.gitignore Version 1.0.0 Sep 6, 2013
.rubocop.yml Updated rubocop and codeclimate configs May 10, 2016
.travis.yml Update dependencies. Tested with ruby 2.1, 2.2, 2.3 Mar 30, 2016
Gemfile Added codeclimate test reporter May 10, 2016
Gemfile.lock Added codeclimate test reporter May 10, 2016
MIT-LICENSE Version 1.0.0 Sep 6, 2013
README.md Added test coverage badge to README May 10, 2016
Rakefile Cleanup Mar 30, 2016
yahoo_weather.gemspec

README.md

yahoo_weather

Build Status Code Climate Test Coverage

A Ruby object-oriented interface to the Yahoo! Weather JSON API.

It supports caching and i18n.

Installation

$ gem install yahoo_weather

Include in your Gemfile:

gem 'yahoo_weather'

API

http://developer.yahoo.com/weather/

Example

Fetch by woeid:

client = YahooWeather::Client.new
response = client.fetch(12797168)
response.units.temperature        # "F"
response.condition.temp           # 60
response.wind.direction           # 110
response.wind.direction('string') # "ESE"
response.condition.code           # 29
response.condition.code('string') # "Partly cloudy (night)"

FYI: If you want to use string condition code don't forget to copy locales

Fetch by location:

client = YahooWeather::Client.new
response = client.fetch_by_location('New York')

Locales

Copy locale command:

rails g yahoo_weather:copy_locale en

Available Locales

Available locales are:

en, ru

License

MIT License. Copyright 2013 Ildar Manzhikov manzhikov@gmail.com. http://manzhikov.com