proxy_fetcher 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 24b80ab944bf6a891aa4a22db877cdd19250fbcf
4
- data.tar.gz: e5a0a514f316ee3cc098d264980ead131d64c276
3
+ metadata.gz: 6488affbd2b24a9b2f09a5698155a2e85295973b
4
+ data.tar.gz: 5e2f692f94aae084aa8682ebad19c08bb21321c9
5
5
  SHA512:
6
- metadata.gz: 24c86d79b5a749c5c0b221562200936fbd099a481530fab31b85005652dc54f3dd67d17161119d32500da0a267b38ee56f2c44c2a52f6329e4ad1b83f2eb5cd8
7
- data.tar.gz: 0e4b04ed465e17fdd2967f2fac0734219c119ad2f224b2b436cd449efdf83e5896673a81da07e4e70cae02d856ee3630f27ca759bc4a933c252e161864fe8508
6
+ metadata.gz: 3fd2a3ccfed0c0f7f3f28d6e26cbb03582b0a57e3ed2118c5a31cf8c09880f53c67484aa2bfe836588386d913dd9c3709d1fd19ef367b6b3dad74d35e20b8633
7
+ data.tar.gz: fb626f96063cf68d7beaa2e09bdc462ec93ab0d82c1223ba60f84371905c89774df7bca6a11335ad49ccab10af414b8fa5d923d693bf9da001f52f121ba9f737
data/README.md CHANGED
@@ -130,6 +130,9 @@ Currently ProxyFetcher can deal with next proxy providers (services):
130
130
  * Hide My Name (default one)
131
131
  * Free Proxy List
132
132
  * HideMyAss
133
+ * Hidster
134
+ * Proxy Docker
135
+ * XRoxy
133
136
 
134
137
  If you wanna use one of them just setup required in the config:
135
138
 
@@ -0,0 +1,37 @@
1
+ module ProxyFetcher
2
+ module Providers
3
+ class Hidster < Base
4
+ PROVIDER_URL = 'https://hidester.com/proxylist/'.freeze
5
+
6
+ class << self
7
+ def load_proxy_list
8
+ doc = Nokogiri::HTML(load_html(PROVIDER_URL))
9
+ doc.xpath('//div[@class="proxyListTable"]/table/tbody/tr[@class!="proxy-table-header"]')
10
+ end
11
+ end
12
+
13
+ def parse!(html_entry)
14
+ html_entry.xpath('td').each_with_index do |td, index|
15
+ case index
16
+ when 1
17
+ set!(:addr, td.content.strip)
18
+ when 2 then
19
+ set!(:port, Integer(td.content.strip))
20
+ when 3 then
21
+ set!(:country, td.content.strip)
22
+ when 4
23
+ set!(:type, td.content.strip)
24
+ when 6
25
+ set!(:response_time, Integer(td.at('p').content.strip[/\d+/]))
26
+ when 7
27
+ set!(:anonymity, td.content.strip)
28
+ else
29
+ # nothing
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
36
+
37
+ ProxyFetcher::Configuration.register_provider(:hidster, ProxyFetcher::Providers::Hidster)
@@ -0,0 +1,36 @@
1
+ module ProxyFetcher
2
+ module Providers
3
+ class ProxyDocker < Base
4
+ PROVIDER_URL = 'https://www.proxydocker.com/en'.freeze
5
+
6
+ class << self
7
+ def load_proxy_list
8
+ doc = Nokogiri::HTML(load_html(PROVIDER_URL))
9
+ doc.xpath('//table[@class="table table-striped"]/tr[(not(@id="proxy-table-header")) and (count(td)>2)]')
10
+ end
11
+ end
12
+
13
+ def parse!(html_entry)
14
+ html_entry.xpath('td').each_with_index do |td, index|
15
+ case index
16
+ when 0
17
+ uri = URI("//#{td.content.strip}")
18
+
19
+ set!(:addr, uri.host)
20
+ set!(:port, uri.port)
21
+ when 1
22
+ set!(:type, td.content.strip)
23
+ when 2
24
+ set!(:anonymity, td.content.strip)
25
+ when 4 then
26
+ set!(:country, td.content.strip)
27
+ else
28
+ # nothing
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
35
+
36
+ ProxyFetcher::Configuration.register_provider(:proxy_docker, ProxyFetcher::Providers::ProxyDocker)
@@ -0,0 +1,38 @@
1
+ module ProxyFetcher
2
+ module Providers
3
+ class XRoxy < Base
4
+ PROVIDER_URL = 'http://www.xroxy.com/proxylist.php?port=&type=All_http'.freeze
5
+
6
+ class << self
7
+ def load_proxy_list
8
+ doc = Nokogiri::HTML(load_html(PROVIDER_URL))
9
+ doc.xpath('//div[@id="content"]/table[1]/tr[contains(@class, "row")]')
10
+ end
11
+ end
12
+
13
+ def parse!(html_entry)
14
+ html_entry.xpath('td').each_with_index do |td, index|
15
+ case index
16
+ when 1
17
+ set!(:addr, td.content.strip)
18
+ when 2
19
+ set!(:port, Integer(td.content.strip))
20
+ when 3
21
+ set!(:anonymity, td.content.strip)
22
+ when 4
23
+ ssl = td.content.strip.downcase
24
+ set!(:type, ssl.include?('true') ? 'HTTPS' : 'HTTP' )
25
+ when 5 then
26
+ set!(:country, td.content.strip)
27
+ when 6
28
+ set!(:response_time, Integer(td.content.strip))
29
+ else
30
+ # nothing
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
37
+
38
+ ProxyFetcher::Configuration.register_provider(:xroxy, ProxyFetcher::Providers::XRoxy)
@@ -9,7 +9,7 @@ module ProxyFetcher
9
9
  # Minor version number
10
10
  MINOR = 2
11
11
  # Smallest version number
12
- TINY = 1
12
+ TINY = 2
13
13
 
14
14
  # Full version number
15
15
  STRING = [MAJOR, MINOR, TINY].compact.join('.')
data/lib/proxy_fetcher.rb CHANGED
@@ -6,9 +6,12 @@ require 'proxy_fetcher/configuration'
6
6
  require 'proxy_fetcher/proxy'
7
7
  require 'proxy_fetcher/manager'
8
8
  require 'proxy_fetcher/providers/base'
9
+ require 'proxy_fetcher/providers/free_proxy_list'
9
10
  require 'proxy_fetcher/providers/hide_my_ass'
10
11
  require 'proxy_fetcher/providers/hide_my_name'
11
- require 'proxy_fetcher/providers/free_proxy_list'
12
+ require 'proxy_fetcher/providers/hidster'
13
+ require 'proxy_fetcher/providers/proxy_docker'
14
+ require 'proxy_fetcher/providers/xroxy'
12
15
 
13
16
  module ProxyFetcher
14
17
  class << self
@@ -5,7 +5,7 @@ require 'proxy_fetcher/version'
5
5
  Gem::Specification.new do |gem|
6
6
  gem.name = 'proxy_fetcher'
7
7
  gem.version = ProxyFetcher.gem_version
8
- gem.date = '2017-07-19'
8
+ gem.date = '2017-07-20'
9
9
  gem.summary = 'Ruby gem for dealing with proxy lists '
10
10
  gem.description = 'This gem can help your Ruby application to make HTTP(S) requests ' \
11
11
  'from proxy server by fetching and validating proxy lists from the different providers.'