-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathExample-Program.rb
More file actions
39 lines (39 loc) · 872 Bytes
/
Example-Program.rb
File metadata and controls
39 lines (39 loc) · 872 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#**
#
# @Name : Example RandomProxy
# @Version : 1.0
# @Programmer : Max
# @Date : 2018-06-26
# @Released under : http://github.com/BaseMax/RandomProxyRuby/blob/master/LICENSE
# @Repository : http://github.com/BaseMax/RandomProxyRuby
#
#**
require 'RandomProxy'
#######################
current=1
total=10
time_sleep=3
#######################
if ARGV[0] && ARGV[0] == "--help" || ARGV[0] == "--h" || ARGV[0] == "help" || ARGV[0] == "h"
puts "ruby RandomProxy.ruby <max_proxy|default:10>"
puts ""
exit
else ARGV[0] then
total=Integer( ARGV[0] )
end
proxy = []
#######################
while current <= total
objs=RandomProxy.get()
puts "----------Proxy #{current}"
if objs["error"] == false then
puts "IP : #{objs["ip"]}"
puts "Port : #{objs["port"]}"
puts response.body
else
puts "Error!"
end
current += 1
sleep(time_sleep)
end
#######################