Created
June 19, 2011 23:35
-
-
Save kryali/1034906 to your computer and use it in GitHub Desktop.
This file contains 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
require 'net/http' | |
my_ip = (require 'open-uri' ; open("http://myip.dk") { |f| /([0-9]{1,3}\.){3}[0-9]{1,3}/.match(f.read)[0] }) | |
puts my_ip | |
counter = 0 | |
proxyFileList = File.new('6_19_2011.txt', 'r') | |
proxyList = [] | |
while (proxy = proxyFileList.gets) | |
proxy = proxy.split(/:|\n|\r/) | |
proxyList << { 'ip' => proxy[0], 'port' => proxy[1]} | |
end | |
proxyFileList.close | |
proxyList.each do |proxy| | |
puts "Checking #{proxy}" | |
attempt = 1 | |
begin | |
Net::HTTP::Proxy(proxy['ip'], proxy['port']).start('proxyjudge.biz') { |http| | |
response = http.request_get('/az.php') | |
if response.body.include?(my_ip) | |
puts "Non-Anonymous Proxy" | |
else | |
puts 'Anonymous Proxy' | |
end | |
} | |
rescue Errno::ECONNREFUSED | |
puts "connection refused (attempt ##{attempt})" | |
if attempt < 5 then· | |
attempt+=1 | |
retry· | |
end | |
rescue | |
puts "proxy failed" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
finally fixed my corrupted ass database, gonna work on this bad unit now!