Created
May 28, 2011 23:51
-
-
Save LegendSzymonP/997351 to your computer and use it in GitHub Desktop.
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
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