proxied 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/proxied.rb +1 -0
- data/lib/proxied/{seeder.rb → importer.rb} +7 -3
- data/lib/proxied/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b63589961f4cbc4d46a03c5c97d88171f5a86af86e6a58f47042336e38fd58d
|
4
|
+
data.tar.gz: e3ae83908238864b37d9d6d78ba1a914157898cf9430fc946d39e8480d7ff5ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: feb8cbe47e0563025c8c497242a5ab3aa982be099a6b457d3bee2dae64f710ec2d67e368eb25de5f0fdaee0249c924c073a9c2a9d1b6d3c3dc9bcc2654eb7448
|
7
|
+
data.tar.gz: a0799134b33788cc919808258a3add09fd881fb7a082de3a62ca91182c831ac4a23fa90827673cd436802537c5f9b021219e32dab2fc196ad1c74a64070dc3e5
|
data/lib/proxied.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
module Proxied
|
2
|
-
class
|
2
|
+
class Importer
|
3
3
|
|
4
4
|
# Expected format:
|
5
5
|
# {
|
@@ -8,14 +8,16 @@ module Proxied
|
|
8
8
|
# protocol (http,socks)
|
9
9
|
# proxy_type (private,public)
|
10
10
|
# category
|
11
|
+
# country
|
12
|
+
# city
|
11
13
|
# username
|
12
14
|
# password
|
13
15
|
# }
|
14
16
|
|
15
|
-
def import(proxies)
|
17
|
+
def self.import(proxies)
|
16
18
|
proxies.each do |proxy_item|
|
17
19
|
query = {
|
18
|
-
host: proxy_item[:
|
20
|
+
host: proxy_item[:host]&.to_s&.strip,
|
19
21
|
port: proxy_item[:port]&.to_s&.strip&.to_i
|
20
22
|
}
|
21
23
|
|
@@ -23,6 +25,8 @@ module Proxied
|
|
23
25
|
protocol: proxy_item.fetch(:protocol, "http")&.to_s&.strip&.downcase,
|
24
26
|
proxy_type: proxy_item.fetch(:type, :private)&.to_s&.strip,
|
25
27
|
category: proxy_item.fetch(:category, nil)&.to_s&.strip&.downcase,
|
28
|
+
country: proxy_item.fetch(:country, nil)&.to_s&.strip&.downcase,
|
29
|
+
city: proxy_item.fetch(:city, nil)&.to_s&.strip&.downcase,
|
26
30
|
username: proxy_item.fetch(:username, nil)&.to_s&.strip,
|
27
31
|
password: proxy_item.fetch(:password, nil)&.to_s&.strip
|
28
32
|
}.merge(query)
|
data/lib/proxied/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: proxied
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sebastian
|
@@ -291,12 +291,12 @@ files:
|
|
291
291
|
- lib/proxied.rb
|
292
292
|
- lib/proxied/checker.rb
|
293
293
|
- lib/proxied/configuration.rb
|
294
|
+
- lib/proxied/importer.rb
|
294
295
|
- lib/proxied/jobs/check_proxies_job.rb
|
295
296
|
- lib/proxied/jobs/check_proxy_job.rb
|
296
297
|
- lib/proxied/logger.rb
|
297
298
|
- lib/proxied/nosql/proxy_methods.rb
|
298
299
|
- lib/proxied/railtie.rb
|
299
|
-
- lib/proxied/seeder.rb
|
300
300
|
- lib/proxied/shared.rb
|
301
301
|
- lib/proxied/sql/proxy_methods.rb
|
302
302
|
- lib/proxied/version.rb
|