Skip to content

Instantly share code, notes, and snippets.

@szymon-przybyl
Created May 28, 2011 23:51
Show Gist options
  • Save szymon-przybyl/997351 to your computer and use it in GitHub Desktop.
Save szymon-przybyl/997351 to your computer and use it in GitHub Desktop.
class LocatorController < ApplicationController
def autocomplete
require 'net/http'
require 'net/https'
url = URI.parse 'https://maps.googleapis.com/maps/api/place/autocomplete/json?language=pl&input=Polichno&sensor=false&key=ABQIAAAAHyX2ujLFqkeXszJQ65ZPbhT2yXp_ZAY8_ufC3CFXhHIE1NvwkxTCcRPSPSwcyYGhNTuA3d46XxgyQg'
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
req = Net::HTTP::Get.new(url.path)
res = http.request(req)
puts res
exit
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment