earth-tools
What
EarthTools.org Web Services Library
Installing
sudo gem install earth-tools
Requirements
- Nokogiri
Usage
Requiring
require 'earth_tools'
Current time given a latitude longitude
EarthTools.timezone({ :latitude => 42.3583333, :longitude => -71.0602778 }).isotime => "2009-07-02 18:28:37 -0500"
Timezone offset given a latitude longitude
EarthTools.timezone({ :latitude => 42.3583333, :longitude => -71.0602778 }).offset => "-5"
Sunrise time given a latitude longitude and date
EarthTools.sun({ :latitude => 42.3583333, :longitude => -71.0602778, :day => 1, :month => 10 }).morning.sunrise => "05:42:09"
Sunset time given a latitude longitude and date
EarthTools.sun({ :latitude => 42.3583333, :longitude => -71.0602778, :day => 1, :month => 10 }).evening.sunset => "17:24:15"
Links
Source
git clone git://github.com/psergi/earth-tools.git
License
This code is free to use under the terms of the MIT license.
Phil Sergi, 2nd July 2009
Theme extended from Paul Battley