Created
July 9, 2013 09:56
-
-
Save brgnepal/5956145 to your computer and use it in GitHub Desktop.
sinatra_street_view.rb for 1st iteration.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice work! Maybe get rid of the
address
variable inget '/' do