This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
Run the following if you haven't already:
gem sources -a http://gems.github.com
Install the gem(s):
sudo gem install peteonrails-gps_fu
commit 7136dd67deeeb464fa38c25623dcc29f38d265aa
tree a8e5141649cb0755aafe74020a84a23a750b5235
parent cd303594e09e936335e2a19adea779e113682ce5
tree a8e5141649cb0755aafe74020a84a23a750b5235
parent cd303594e09e936335e2a19adea779e113682ce5
gps_fu /
| name | age | message | |
|---|---|---|---|
| |
LICENSE | Wed Sep 24 22:30:21 -0700 2008 | |
| |
README | ||
| |
Rakefile | Wed Sep 24 22:30:21 -0700 2008 | |
| |
autotest/ | Wed Sep 24 22:30:21 -0700 2008 | |
| |
gps_fu.gemspec | Wed Sep 24 22:30:21 -0700 2008 | |
| |
init.rb | ||
| |
install.rb | Wed Sep 24 22:30:21 -0700 2008 | |
| |
lib/ | Wed Sep 24 22:30:21 -0700 2008 | |
| |
rails/ | ||
| |
spec/ | ||
| |
tasks/ | Wed Sep 24 22:30:21 -0700 2008 | |
| |
uninstall.rb | Wed Sep 24 22:30:21 -0700 2008 |
GpsFu
=====
This is a Location Based Services API for Ruby and for Ruby on Rails. It currently
supports translation of MyGPSId address_ids into geocoded data. Queries will return
Hpricot documents that you can use to find address elements in the return packet.
You can also pass those Hpricot documents to a Location object and use it instead.
Installing
==========
script/plugin install git://github.com/peteonrails/gps_fu.git
Example
=======
To turn an address id of "pete@work" into a geo-approximate location packet, do the following:
@hpricot_doc = GPSFu::MyGPSId::Client.id_to_geocode("pete@work", :api_key=>"mykey")
# now you can find out approximately where I am:
puts (@hpricot_doc.xml/"address/city").inner_html # "Bethesda"
puts (@hpricot_doc.xml/"address/country-code").inner_html # "US"
Or, if you'd rather not parse the Hpricot document, you can use the included Location class:
@loc = Location.new(GPSFu::MyGPSId::Client.id_to_geocode("pete@work", :api_key=>"mykey"))
puts @loc.city
puts @loc.country_code
puts @loc.lat # latitude
puts @loc.lng # longitude
puts @loc.postal_code
puts @loc.postal_district
puts @loc.state
Consideration
=============
If you like this software and use it, please consider recommending me on Working With Rails.
I don't want donations: a simple up-vote would make my day. My profile is:
http://www.workingwithrails.com/person/12521-peter-jackson
To go directly to the "Recommend Me" screen:
http://www.workingwithrails.com/recommendation/new/person/12521-peter-jackson
Copyright (c) 2008 Peter Jackson, released under the MIT license












