proxy_fetcher 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -0
- data/lib/proxy_fetcher/providers/hidster.rb +37 -0
- data/lib/proxy_fetcher/providers/proxy_docker.rb +36 -0
- data/lib/proxy_fetcher/providers/xroxy.rb +38 -0
- data/lib/proxy_fetcher/version.rb +1 -1
- data/lib/proxy_fetcher.rb +4 -1
- data/proxy_fetcher.gemspec +1 -1
- data/spec/fixtures/hidster.html +3048 -0
- data/spec/fixtures/proxy_docker.html +3959 -0
- data/spec/fixtures/xroxy.html +548 -0
- data/spec/proxy_fetcher/providers/hidster_spec.rb +14 -0
- data/spec/proxy_fetcher/providers/proxy_docker_spec.rb +14 -0
- data/spec/proxy_fetcher/providers/xroxy_spec.rb +14 -0
- metadata +11 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6488affbd2b24a9b2f09a5698155a2e85295973b
|
4
|
+
data.tar.gz: 5e2f692f94aae084aa8682ebad19c08bb21321c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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)
|
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/
|
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
|
data/proxy_fetcher.gemspec
CHANGED
@@ -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-
|
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.'
|