Skip to content

Hakon/yr_api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

5c5108d · Dec 17, 2010

History

20 Commits
Mar 23, 2008
Mar 23, 2008
Dec 17, 2010
Mar 23, 2008
Mar 23, 2008
Mar 23, 2008
Mar 23, 2008
Mar 24, 2008
Mar 18, 2008
Mar 18, 2008
Mar 24, 2008
Jan 13, 2010
Mar 18, 2008
Mar 18, 2008
Dec 16, 2010

Repository files navigation

= Yr: a ruby lib for accessing yr.no's weather service

This is a Ruby API towards the Norwegian weather API site yr.no

== Examples:

=== By named place:

* You can look up the weather given the name of a place.

    require 'lib/yr'
	  oslo = Yr::Place.find("oslo")
	  todays_forecast = oslo.forecasts_for(Time.now)
	  puts "Forecast for #{todays_forecast.title}:"
	  puts todays_forecast.body


=== By position:

* You can also look up the weather given a position (longitude + latitude)

    require 'lib/yr'
    location = Yr::Location.new(10.80, 10.22)
    puts location.current_weather   # Will show the current weather at +location+

== Checkout the source

* Check out the source
The source is found at http://gitorious.org/projects/yr-api

* To install this code:
    
    gem install yr_api
    
Thanks to judofyr for cleaning up!