Gps Fu plugin
Plugin details
Documentation
Install the plugin:
ruby script/plugin install git://github.com/peteonrails/gps_fu.git
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
Further Documentation
There is currently no advanced documentation for this plugin.
New documentationEdit plugin | (0 older versions) | Last edited by: scott, about 1 month ago

