proxy_pool 0.1.2 → 0.1.3
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 +4 -4
- data/lib/proxy_pool/dealer.rb +3 -3
- data/lib/proxy_pool/version.rb +1 -1
- data/lib/proxy_pool.rb +16 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 91b8f68f49e945f8138a4b44898cabec2e0c547d266c8f1fa3bee4f812834123
|
4
|
+
data.tar.gz: a140daaf608931a1f02c003ff95c2a39b634a1bd90e23d0f785c9dd51a8a5f43
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85e6ddfacd502eebf0b9c75538e621342f447f222e13915228bfc073aa0a5cced67d0aeac4ad2ed3799c3c5b892bdb19f0907ee4ef6aef259ff8e29413b4932b
|
7
|
+
data.tar.gz: cbc1f7cd40f2d368bb0eeab63a9749ae896fa1895d8f09ffa0c01dbea570b4ebc774f384d39d0016717bb7bdfabb39baac9db9974f9979ad3adbb7e5202ef2ba
|
data/lib/proxy_pool/dealer.rb
CHANGED
@@ -46,10 +46,10 @@ module ProxyPool
|
|
46
46
|
#
|
47
47
|
# @param anonymous [Boolean] Return high anonymous proxy if true
|
48
48
|
# @param filter [Hash] Filter
|
49
|
-
# @param
|
49
|
+
# @param force_update [Boolean] Update pool before select proxy server
|
50
50
|
# @return [Hash] Proxy
|
51
|
-
def get(anonymous=true, filter={},
|
52
|
-
update if
|
51
|
+
def get(anonymous=true, filter={}, force_update=false)
|
52
|
+
update if force_update || (@transparent_pools.nil? && @anonymous_pools.nil?)
|
53
53
|
|
54
54
|
target_pools = if anonymous
|
55
55
|
@anonymous_pools
|
data/lib/proxy_pool/version.rb
CHANGED
data/lib/proxy_pool.rb
CHANGED
@@ -19,6 +19,14 @@ module ProxyPool
|
|
19
19
|
ProxyPool::Dealer.instance.get(true, filter)
|
20
20
|
end
|
21
21
|
|
22
|
+
# Update and get anonymous proxy from pool randomly
|
23
|
+
#
|
24
|
+
# @param filter [Hash] Filter
|
25
|
+
# @return [Hash] Proxy
|
26
|
+
def get_anonymous_proxy!(filter={})
|
27
|
+
ProxyPool::Dealer.instance.get(true, filter, true)
|
28
|
+
end
|
29
|
+
|
22
30
|
# Get transparent proxy from pool randomly
|
23
31
|
#
|
24
32
|
# @param filter [Hash] Filter
|
@@ -26,6 +34,14 @@ module ProxyPool
|
|
26
34
|
def get_transparent_proxy(filter={})
|
27
35
|
ProxyPool::Dealer.instance.get(false, filter)
|
28
36
|
end
|
37
|
+
|
38
|
+
# Update and get transparent proxy from pool randomly
|
39
|
+
#
|
40
|
+
# @param filter [Hash] Filter
|
41
|
+
# @return [Hash] Proxy
|
42
|
+
def get_transparent_proxy!(filter={})
|
43
|
+
ProxyPool::Dealer.instance.get(false, filter, true)
|
44
|
+
end
|
29
45
|
end
|
30
46
|
|
31
47
|
end
|