Class: HideMyAss::Proxy::HideMe

Inherits:
Base
  • Object
show all
Defined in:
lib/hidemyass/proxy/hide_me.rb

Overview

Represent one proxy instance from hideme.ru/proxy-list

Instance Attribute Summary

Attributes inherited from Base

#row

Instance Method Summary collapse

Methods inherited from Base

#anonym?, #http?, #https?, #initialize, #inspect, #protocol, #rel_url, #secure?, #socks?, #ssl?, #url

Constructor Details

This class inherits a constructor from HideMyAss::Proxy::Base

Instance Method Details

#anonymityString

The level of anonymity in downcase letters. (low, medium, high, …)

Returns:

  • (String)


49
50
51
# File 'lib/hidemyass/proxy/hide_me.rb', line 49

def anonymity
  @anonymity ||= @row.at_xpath('td[6]').text.strip.downcase!
end

#countryString

The country where the proxy is hosted in downcase letters.

Returns:

  • (String)


24
25
26
27
# File 'lib/hidemyass/proxy/hide_me.rb', line 24

def country
  @country ||= @row.at_xpath('td[3]/div/text()')
                   .text.strip.downcase!.scan(/[[:word:]]+$/).last
end

#ipString

The IP of the proxy server.

Returns:

  • (String)


10
11
12
# File 'lib/hidemyass/proxy/hide_me.rb', line 10

def ip
  @ip ||= @row.at_xpath('td[1]/text()').text.strip
end

#last_checkInt

Time in minutes when its been last checked.

Returns:

  • (Int)


56
57
58
# File 'lib/hidemyass/proxy/hide_me.rb', line 56

def last_check
  @last_check ||= @row.at_xpath('td[7]/text()').text.scan(/^\d+/)[0].to_i
end

#portInt

The port for the proxy.

Returns:

  • (Int)


17
18
19
# File 'lib/hidemyass/proxy/hide_me.rb', line 17

def port
  @port ||= @row.at_xpath('td[2]/text()').text.strip.to_i
end

#speedInt

The average response time in milliseconds.

Returns:

  • (Int)


32
33
34
35
# File 'lib/hidemyass/proxy/hide_me.rb', line 32

def speed
  @speed ||= @row.at_xpath('td[4]/div/div/p/text()')
                 .text.scan(/^\d+/)[0].to_i
end

#typeString

The network protocol in in downcase letters. (https or http or socks)

Returns:

  • (String)


41
42
43
# File 'lib/hidemyass/proxy/hide_me.rb', line 41

def type
  @type ||= @row.at_xpath('td[5]/text()').text.strip.split.last.downcase!
end