After releasing my preliminary code for del.icio.us I’m releasing my preliminary code for mapquest’s OpenAPI service: ruby-Mapquest.
Archive for February 11th, 2007
Changelog (Click Version To View/Download)
- Version 0.005
- Addition: thumb_height, thumb_width, thumb_style, thumb_type, thumb_url to route rval when available (per turn)
- Version 0.004
- Addition: apistatus to geocode rval
- Addition: geocode status to geocode rval
- Addition: geocode quality to geocode rval
- Documentation: Added commas to geocoding example… oops
- Version 0.003
- bugfix: added apikey to overviewmap
- bugfix: distance is now a float value
- change: overview metrics renamed from maneuver_foo to maneuvers_foo
- Addition: [:debugurl] for manual inspection of values returned from mapquest’s api
- Version 0.002
- Addition: Routing Support
- Version 0.001
- Initial Release
Warranty: None, at all, whatsoever, use at your own risk, may burn down your house and knock over your garbage cans and return the car with the gas level on “E” and refuse to return your lawnmower even though it’s now 7 months later and you’re growing a small rainforest out back… might fall asleep while watching your children, forget to pay the electric bill, and run up massive credit card debt. In other words. You’re on your own. Dont come crying to me!
To use this client you have to first apply for a mapquest openapi key here Then you must add “*” as a referrer under “my account” for your openapi ke
Example usage:
mq = Mapquest.new(“foobazbazbooblah”)
#Geocoding
myLocation = {
:address => “555 17th Street, Suite 1600″,
:city => “Denver”,
:state => “Colorado”,
:zip => 80202,
}
puts mq.geocode(myLocation).inspect#Routing
route_request = {
:addressOrigin => {
:name => “Yahoo!”,
:address => “701 First Avenue”,
:city => “Sunnyvale”,
:stateProvince => “ca”,
},
:addressDestination => {
:name => “Google”,
:address => “1600 Amphitheatre Parkway”,
:city => ” Mountain View”,
:stateProvince => “ca”,
},
}
puts mq.route(route_request).inspect
As simple as it gets, no? Cheers!