-
-
Save ashaw/724303 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
module Graticule #:nodoc: | |
module Geocoder #:nodoc: | |
class Google | |
def initialize(key) | |
@key = key | |
@proxies = ["http://127.0.0.1:8080", "http://127.0.0.1:8081", "http://127.0.0.1:8082"] | |
@url = URI.parse @proxies[rand(@proxies.length)] + '/maps/geo' | |
end | |
end | |
end | |
end | |
task :proxies => :environment do | |
todo = [] | |
#todo << "killall ssh" | |
todo << "ssh -f domain1 -L 8080:maps.google.com:80 -N" | |
todo << "ssh -f domain2 -L 8081:maps.google.com:80 -N" | |
todo << "ssh -f domain3 -L 8082:maps.google.com:80 -N" | |
`#{todo.join("&&")}` | |
end | |
geocoder = Graticule.service(:google).new "" | |
ll = geocoder.locate full_address | |
ll.coordinates |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment