module ProxyPool

Constants

VERSION

Public Class Methods

get(&block) click to toggle source

Get a proxy from proxy pool

@return [Hash] Proxy

# File lib/proxy_pool.rb, line 25
def get(&block)
  ProxyPool::Dealer.instance.get(&block)
end
get_by_country(cn) click to toggle source

Get proxy by country

@param cn [String] Country code @return [Hash] Proxy

# File lib/proxy_pool.rb, line 40
def get_by_country(cn)
  get { |proxy| proxy['country'].downcase == cn.downcase }
end
get_high_anonymous_proxy() click to toggle source

Get high anonymous proxy

@return [Hash] Proxy

# File lib/proxy_pool.rb, line 32
def get_high_anonymous_proxy
  get { |proxy| proxy['anonymity'] == 'high_anonymous' }
end
get_http_proxy() click to toggle source

Get http proxy

@return [Hash] Proxy

# File lib/proxy_pool.rb, line 47
def get_http_proxy
  get { |proxy| proxy['type'] == 'http' }
end
get_https_proxy() click to toggle source

Get https proxy

@return [Hash] Proxy

# File lib/proxy_pool.rb, line 54
def get_https_proxy
  get { |proxy| proxy['type'] == 'https' }
end
remove(proxy) click to toggle source

Remove this proxy from pool

@param proxy [Hash] Proxy @return [nil]

# File lib/proxy_pool.rb, line 62
def remove(proxy)
  ProxyPool::Dealer.instance.remove(proxy)
end
update() click to toggle source

Update proxy pool

# File lib/proxy_pool.rb, line 18
def update
  ProxyPool::Dealer.instance.update
end