module ProxyFetcher module Providers class FreeProxyListSSL < Base PROVIDER_URL = 'https://www.sslproxies.org/'.freeze class << self def load_proxy_list doc = Nokogiri::HTML(load_html(PROVIDER_URL)) doc.xpath('//table[@id="proxylisttable"]/tbody/tr') end end def parse!(html_entry) html_entry.xpath('td').each_with_index do |td, index| case index when 0 set!(:addr, td.content.strip) when 1 then set!(:port, Integer(td.content.strip)) when 3 then set!(:country, td.content.strip) when 4 set!(:anonymity, td.content.strip) when 6 set!(:type, 'HTTPS') else # nothing end end end end ProxyFetcher::Configuration.register_provider(:free_proxy_list_ssl, FreeProxyListSSL) end end