snov 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0e2c1f129ba398f54a6a910cdcdb3cbf13920abe6ae32651b5f137c8d324d2d8
4
- data.tar.gz: ae1b8107f3904cebb48367c98213e49f0f78ff76a4661273af5a5bf656fbaed2
3
+ metadata.gz: aec74bea1292e576ef497f2250c1833593742504c74834d05749bb8efdb88884
4
+ data.tar.gz: b85b04071c54d309c0dfa22c9b5c77e3a2273b4d370f0449e0b4952c2b295f6c
5
5
  SHA512:
6
- metadata.gz: 00c6f62c9d033943d244453672ba2951aea873e967359148d0411d4faeed1548fa2cf7cbc247b18b04e52e865b2c91658e4f0fa84ea351f66e150be50f7674fb
7
- data.tar.gz: 82875dbb5bfdc6555d98866a6f9e96d2dd7b7bde9209c7d1fe90a2ff78378c17c1f2d1cd3bd201ef4991ae55f3d3c79e7b3c11022a244685ac2d56db9c6631fc
6
+ metadata.gz: 0a509e0cdf66cb198c734a94fd81ef667506a4f96686b6d7c1e5720f4b26ba5389812894201bc11cc2b537bd45cc02d92ab4d1d9bf2f7856cc63c22077de6153
7
+ data.tar.gz: cc4f5022bca9c9f8e3a2fca2a04bc1b8435e4d6afbc3dd568fabce50168fdbca1dafa5397894dd63e899e564bbf66375fda450f64d6112505124435645342c2a
@@ -2,6 +2,7 @@ require:
2
2
  - rubocop-rspec
3
3
 
4
4
  AllCops:
5
+ SuggestExtensions: false
5
6
  NewCops: enable
6
7
  Exclude:
7
8
  - 'vendor/**/*'
@@ -1,3 +1,6 @@
1
+ ## [0.2.0]
2
+ * DomainSearch
3
+
1
4
  ## [0.1.1]
2
5
 
3
6
  ### Fixed
data/README.md CHANGED
@@ -20,6 +20,24 @@ Or install it yourself as:
20
20
 
21
21
  set `SNOV_USER_ID` and `SNOV_SECRET` environment variables
22
22
 
23
+ ### DomainSearch
24
+
25
+ see https://snov.io/api#DomainSearch2
26
+
27
+ ```ruby
28
+ results = Snov::DomainSearch.new(domain: "octagon.com", type: "personal", limit: 10)
29
+ results.lastId
30
+ results.each do |result|
31
+ puts result.email
32
+ puts result.first_name
33
+ puts result.last_name
34
+ puts result.position
35
+ puts result.source_page
36
+ puts result.company_name
37
+ puts result.type
38
+ puts result.status
39
+ end
40
+ ```
23
41
 
24
42
  ### GetProfileByEmail
25
43
 
data/gems.rb CHANGED
@@ -9,3 +9,10 @@ gem "rubocop"
9
9
  gem "rubocop-rspec"
10
10
  gem "simplecov"
11
11
  gem "webmock"
12
+
13
+ if ENV['GEM_VERSIONS'] == 'min'
14
+ gem 'activemodel', '~> 4.1.0'
15
+ gem 'activesupport', '~> 4.1.0'
16
+ gem 'faraday', '~> 0.10.0'
17
+ gem 'multi_json', '~> 1.4.0'
18
+ end
@@ -24,3 +24,4 @@ require 'snov/get_all_prospects_from_list'
24
24
  require 'snov/get_prospects_by_email'
25
25
  require 'snov/get_prospect_list'
26
26
  require 'snov/get_user_lists'
27
+ require 'snov/domain_search'
@@ -0,0 +1,50 @@
1
+ require 'active_support/core_ext/array'
2
+ require 'camel_snake_struct'
3
+
4
+ module Snov
5
+ class DomainSearch
6
+ include Enumerable
7
+
8
+ attr_reader :client, :domain, :type, :limit
9
+
10
+ def initialize(domain:, type: 'all', limit: 10, last_id: 0, client: Snov.client)
11
+ @client = client
12
+ @domain = domain
13
+ @type = type
14
+ @limit = limit
15
+ @last_id = last_id
16
+ end
17
+
18
+ def each(&block)
19
+ raw_result.emails.each(&block)
20
+ end
21
+
22
+ def success
23
+ raw_result.success
24
+ end
25
+
26
+ def webmail
27
+ raw_result.webmail
28
+ end
29
+
30
+ def result
31
+ raw_result.result
32
+ end
33
+
34
+ def last_id
35
+ raw_result.last_id
36
+ end
37
+
38
+ def company_name
39
+ raw_result.company_name
40
+ end
41
+
42
+ def raw_result
43
+ CamelSnakeStruct.new(client.post("/v2/domain-emails-with-info",
44
+ 'lastId' => @last_id,
45
+ 'limit' => @limit,
46
+ 'type' => type.to_s,
47
+ 'domain' => domain.to_s))
48
+ end
49
+ end
50
+ end
@@ -1,3 +1,3 @@
1
1
  module Snov
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -24,8 +24,9 @@ Gem::Specification.new do |spec|
24
24
  spec.bindir = "exe"
25
25
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
26
26
  spec.require_paths = ["lib"]
27
- spec.add_dependency 'activemodel'
28
- spec.add_dependency 'activesupport'
29
- spec.add_dependency 'faraday'
30
- spec.add_dependency 'multi_json'
27
+ spec.add_dependency 'activemodel', '>= 4.1.0', '< 7.0'
28
+ spec.add_dependency 'activesupport', '>= 4.1.0', '< 7.0'
29
+ spec.add_dependency 'camel_snake_struct', '>= 0.1.0', '< 2.0'
30
+ spec.add_dependency 'faraday', '>= 0.10.0', '< 2.0'
31
+ spec.add_dependency 'multi_json', '>= 1.4.0', '< 2.0'
31
32
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snov
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Grant Petersen-Speelman
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-11-29 00:00:00.000000000 Z
11
+ date: 2021-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -16,56 +16,100 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: 4.1.0
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '7.0'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
27
  - - ">="
25
28
  - !ruby/object:Gem::Version
26
- version: '0'
29
+ version: 4.1.0
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '7.0'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: activesupport
29
35
  requirement: !ruby/object:Gem::Requirement
30
36
  requirements:
31
37
  - - ">="
32
38
  - !ruby/object:Gem::Version
33
- version: '0'
39
+ version: 4.1.0
40
+ - - "<"
41
+ - !ruby/object:Gem::Version
42
+ version: '7.0'
34
43
  type: :runtime
35
44
  prerelease: false
36
45
  version_requirements: !ruby/object:Gem::Requirement
37
46
  requirements:
38
47
  - - ">="
39
48
  - !ruby/object:Gem::Version
40
- version: '0'
49
+ version: 4.1.0
50
+ - - "<"
51
+ - !ruby/object:Gem::Version
52
+ version: '7.0'
53
+ - !ruby/object:Gem::Dependency
54
+ name: camel_snake_struct
55
+ requirement: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ version: 0.1.0
60
+ - - "<"
61
+ - !ruby/object:Gem::Version
62
+ version: '2.0'
63
+ type: :runtime
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: 0.1.0
70
+ - - "<"
71
+ - !ruby/object:Gem::Version
72
+ version: '2.0'
41
73
  - !ruby/object:Gem::Dependency
42
74
  name: faraday
43
75
  requirement: !ruby/object:Gem::Requirement
44
76
  requirements:
45
77
  - - ">="
46
78
  - !ruby/object:Gem::Version
47
- version: '0'
79
+ version: 0.10.0
80
+ - - "<"
81
+ - !ruby/object:Gem::Version
82
+ version: '2.0'
48
83
  type: :runtime
49
84
  prerelease: false
50
85
  version_requirements: !ruby/object:Gem::Requirement
51
86
  requirements:
52
87
  - - ">="
53
88
  - !ruby/object:Gem::Version
54
- version: '0'
89
+ version: 0.10.0
90
+ - - "<"
91
+ - !ruby/object:Gem::Version
92
+ version: '2.0'
55
93
  - !ruby/object:Gem::Dependency
56
94
  name: multi_json
57
95
  requirement: !ruby/object:Gem::Requirement
58
96
  requirements:
59
97
  - - ">="
60
98
  - !ruby/object:Gem::Version
61
- version: '0'
99
+ version: 1.4.0
100
+ - - "<"
101
+ - !ruby/object:Gem::Version
102
+ version: '2.0'
62
103
  type: :runtime
63
104
  prerelease: false
64
105
  version_requirements: !ruby/object:Gem::Requirement
65
106
  requirements:
66
107
  - - ">="
67
108
  - !ruby/object:Gem::Version
68
- version: '0'
109
+ version: 1.4.0
110
+ - - "<"
111
+ - !ruby/object:Gem::Version
112
+ version: '2.0'
69
113
  description: Snov client to interact with snov api
70
114
  email:
71
115
  - grantspeelman@gmail.com
@@ -88,6 +132,7 @@ files:
88
132
  - gems.rb
89
133
  - lib/snov.rb
90
134
  - lib/snov/client.rb
135
+ - lib/snov/domain_search.rb
91
136
  - lib/snov/fake_client.rb
92
137
  - lib/snov/fake_client/get_v1_get-user-lists.json
93
138
  - lib/snov/fake_client/post_v1_get-profile-by-email.json