proxy_fetcher 0.6.3 → 0.6.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/proxy_fetcher/document/node.rb +1 -1
- data/lib/proxy_fetcher/providers/base.rb +1 -1
- data/lib/proxy_fetcher/providers/free_proxy_list.rb +1 -1
- data/lib/proxy_fetcher/providers/free_proxy_list_ssl.rb +1 -1
- data/lib/proxy_fetcher/providers/xroxy.rb +1 -1
- data/lib/proxy_fetcher/version.rb +1 -1
- data/proxy_fetcher.gemspec +0 -1
- data/spec/proxy_fetcher/client/client_spec.rb +3 -1
- data/spec/proxy_fetcher/version_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 72290c2f3d9a544d65874bfd0c6ff98c38938ed0
|
4
|
+
data.tar.gz: c57b914d49204016231bc565f0ec03a98cf8893b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dacd5882b6397ec980ce35040b10ef5c5aa0eca57cb7e708d71fc60de67a5375e351a2021a4e37804a6eab629ae3a792ca4b523d9675c1af1ad5fafb6e21c589
|
7
|
+
data.tar.gz: a2e0fabc4062f425871751f72af4bafae315d5b4e0f8795b0f6532ca7a2fd4fff8d948d348869dbd9c8f382fcc0dae66b0ae504f0bdac0cb71e729a2ad54568a
|
@@ -7,7 +7,7 @@ module ProxyFetcher
|
|
7
7
|
# Loads proxy provider page content, extract proxy list from it
|
8
8
|
# and convert every entry to proxy object.
|
9
9
|
def fetch_proxies!(filters = {})
|
10
|
-
load_proxy_list(filters).map { |
|
10
|
+
load_proxy_list(filters).map { |html_node| to_proxy(html_node) }
|
11
11
|
end
|
12
12
|
|
13
13
|
# Just synthetic sugar to make it easier to call #fetch_proxies! method.
|
@@ -25,7 +25,7 @@ module ProxyFetcher
|
|
25
25
|
def to_proxy(html_node)
|
26
26
|
ProxyFetcher::Proxy.new.tap do |proxy|
|
27
27
|
proxy.addr = html_node.content_at('td[1]')
|
28
|
-
proxy.port = Integer(html_node.content_at('td[2]'))
|
28
|
+
proxy.port = Integer(html_node.content_at('td[2]').gsub(/^0+/, ''))
|
29
29
|
proxy.country = html_node.content_at('td[4]')
|
30
30
|
proxy.anonymity = html_node.content_at('td[5]')
|
31
31
|
proxy.type = parse_type(html_node)
|
@@ -32,7 +32,7 @@ module ProxyFetcher
|
|
32
32
|
def to_proxy(html_node)
|
33
33
|
ProxyFetcher::Proxy.new.tap do |proxy|
|
34
34
|
proxy.addr = html_node.content_at('td[1]')
|
35
|
-
proxy.port = Integer(html_node.content_at('td[2]'))
|
35
|
+
proxy.port = Integer(html_node.content_at('td[2]').gsub(/^0+/, ''))
|
36
36
|
proxy.country = html_node.content_at('td[4]')
|
37
37
|
proxy.anonymity = html_node.content_at('td[5]')
|
38
38
|
proxy.type = ProxyFetcher::Proxy::HTTPS
|
@@ -31,7 +31,7 @@ module ProxyFetcher
|
|
31
31
|
def to_proxy(html_node)
|
32
32
|
ProxyFetcher::Proxy.new.tap do |proxy|
|
33
33
|
proxy.addr = html_node.content_at('td[2]')
|
34
|
-
proxy.port = Integer(html_node.content_at('td[3]'))
|
34
|
+
proxy.port = Integer(html_node.content_at('td[3]').gsub(/^0+/, ''))
|
35
35
|
proxy.anonymity = html_node.content_at('td[4]')
|
36
36
|
proxy.country = html_node.content_at('td[6]')
|
37
37
|
proxy.response_time = Integer(html_node.content_at('td[7]'))
|
data/proxy_fetcher.gemspec
CHANGED
@@ -5,7 +5,6 @@ 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 = '2018-02-13'
|
9
8
|
gem.summary = 'Ruby gem for dealing with proxy lists from different providers'
|
10
9
|
gem.description = 'This gem can help your Ruby application to make HTTP(S) requests ' \
|
11
10
|
'using proxies by fetching and validating proxy lists from the different providers.'
|
@@ -45,7 +45,9 @@ describe ProxyFetcher::Client do
|
|
45
45
|
|
46
46
|
it 'successfully returns page content using custom proxy' do
|
47
47
|
manager = ProxyFetcher::Manager.new
|
48
|
-
|
48
|
+
|
49
|
+
proxy = manager.get! until proxy
|
50
|
+
content = ProxyFetcher::Client.get('http://httpbin.org', options: { proxy: proxy })
|
49
51
|
|
50
52
|
expect(content).not_to be_nil
|
51
53
|
expect(content).not_to be_empty
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: proxy_fetcher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nikita Bulai
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|