https://github.com/venables/where
A very simple geolocation library in Ruby
https://github.com/venables/where
Last synced: about 1 year ago
JSON representation
A very simple geolocation library in Ruby
- Host: GitHub
- URL: https://github.com/venables/where
- Owner: venables
- License: mit
- Created: 2010-10-04T04:01:13.000Z (almost 16 years ago)
- Default Branch: master
- Last Pushed: 2013-02-25T16:04:16.000Z (over 13 years ago)
- Last Synced: 2025-05-16T02:38:57.281Z (about 1 year ago)
- Language: Ruby
- Homepage:
- Size: 109 KB
- Stars: 6
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
Where
=====
A basic geolocation library for Ruby.
Installation
------------
Add this line to your application's Gemfile:
gem 'where'
And then execute:
$ bundle
Or install it yourself as:
$ gem install where
Usage
-----
Search by Address:
result = Where.is '4 yawkey way boston ma'
if result.success?
puts "Address: #{result.address}"
puts "Street Number: #{result.street_number}"
puts "Street: #{result.street}"
puts "City: #{result.city}"
puts "State: #{result.state}"
puts "Zip: #{result.postal_code}"
puts "Country: #{result.country}"
puts "Lat: #{result.lat}"
puts "Lng: #{result.lng}"
end
Or, by IP-Address:
result = Where.is "173.194.33.104"
...
Testing
-------
Run the spec suite by running:
rspec
Copyright
---------
Copyright (c) 2013 Matt Venables. See LICENSE.txt for details.