Method: HideMyAss#proxies

Defined in:
lib/hidemyass.rb

#proxiesObject

Returns HMA proxies.



52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/hidemyass.rb', line 52

def proxies
  clear_cache if options[:clear_cache]

  @proxies ||= begin
    html = get_hma_body

    html.xpath('//table[@id="listtable"]/tr').collect do |node|
      ip = HideMyAss::IP.new(node.at_xpath('td[2]/span'))
      next unless ip.valid?
      {
        host: ip.address,
        port: node.at_xpath('td[3]').content.strip
      }
    end.compact
  end
end