Class: HideMyAss::Proxy::HideMe
- 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
Instance Method Summary collapse
-
#anonymity ⇒ String
The level of anonymity in downcase letters.
-
#country ⇒ String
The country where the proxy is hosted in downcase letters.
-
#ip ⇒ String
The IP of the proxy server.
-
#last_check ⇒ Int
Time in minutes when its been last checked.
-
#port ⇒ Int
The port for the proxy.
-
#speed ⇒ Int
The average response time in milliseconds.
-
#type ⇒ String
The network protocol in in downcase letters.
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
#anonymity ⇒ String
The level of anonymity in downcase letters. (low, medium, high, …)
49 50 51 |
# File 'lib/hidemyass/proxy/hide_me.rb', line 49 def anonymity @anonymity ||= @row.at_xpath('td[6]').text.strip.downcase! end |
#country ⇒ String
The country where the proxy is hosted in downcase letters.
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 |
#ip ⇒ String
The IP of the proxy server.
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_check ⇒ Int
Time in minutes when its been last checked.
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 |
#port ⇒ Int
The port for the proxy.
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 |
#speed ⇒ Int
The average response time in milliseconds.
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 |
#type ⇒ String
The network protocol in in downcase letters. (https or http or socks)
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 |