Skip to content

Instantly share code, notes, and snippets.

@coolbrg
Created July 9, 2013 09:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save coolbrg/5956145 to your computer and use it in GitHub Desktop.
Save coolbrg/5956145 to your computer and use it in GitHub Desktop.
sinatra_street_view.rb for 1st iteration.
# sinatra_street_view.rb
require 'sinatra'
require 'sinatra/reloader' if development?
def formatted_url(address)
base_url = 'http://maps.googleapis.com/maps/api/geocode/xml?sensor=false&'
encoded_address = URI.encode address
"#{base_url}#{encoded_address}"
end
get '/' do
address = '1600 Amphitheatre Parkway, Mountain View, CA'
p formatted_url address
end
@smtalim
Copy link

smtalim commented Jul 9, 2013

Nice work! Maybe get rid of the address variable in get '/' do

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment