Advertisement
Guest User

Untitled

a guest
Jan 8th, 2015
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.69 KB | None | 0 0
  1. require 'rubygems'
  2. require 'net/http'
  3. require 'open-uri'
  4. require 'nokogiri'
  5. class Proxycheck
  6.     @@str_ip = []
  7.     @@str_port = []
  8.     @@int_count = 0
  9.     @@int_lines = 0
  10.     @@PageUrl = "https://www.google.com/"
  11.     def read_proxies
  12.         begin
  13.             #Reads and checks the proxy list
  14.             file = File.open("Proxy.txt", 'r')
  15.             file.each_line do |line|
  16.                 line_split = line.split(':')
  17.                 @@str_ip << line_split[0]
  18.                 @@str_port << line_split[1]
  19.                 req = ::Net::HTTP.start(@@PageUrl,80,@@str_ip[@@int_count],@@str_port[@@int_count],nil,nil)
  20.                 @@int_count+=1
  21.             end        
  22.             rescue Exception => e
  23.             puts e.message
  24.             puts e.backtrace.inspect
  25.         end
  26.     end
  27. end
  28. bot = Proxycheck.new
  29. bot.read_proxies
  30. sleep(100)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement