snov 0.1.0 → 0.2.3

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: 66024313d2ed01c16ffeeaec3f536f93b00957250903c5d18e3d30458ba4e413
4
- data.tar.gz: e915c4231981bd3fad2d4fd6a7eb18dfcdcc2005058d97202a7374cc76df25a0
3
+ metadata.gz: f455eb1bcf297a8aad704e44c84c18c351656be0b3f7e77e1cc36765323c130f
4
+ data.tar.gz: 23dd283539c2b2e2ba6467153bd812132b9e31fde724ec182d090458f5b7b426
5
5
  SHA512:
6
- metadata.gz: ba368d2617e6b8ca49cb9bcde3c75ed8b43348dd187f7a1f60a459b596f9e1999b282eb940114dae99354330583cc33dcc90e95c8c0a1b13d2fe482daf713058
7
- data.tar.gz: eef471ba1b9bdcf927fa489addafaf3283f083a6067d7a7b3bba8b414dcbccbf31edc2769ad405fb4abc59cb3129753dee699ab86080faced65e1855435ee4d5
6
+ metadata.gz: 534d631fea92f1d34ea89f4c2c9b61f9290c57e1c1ee0a71f669c176379ce5269a872f472bbd5c8d8dda090e58eea2205a37c5c1dec9ea08404a834cb0fea7cc
7
+ data.tar.gz: 9c85a473ab4fdaa9e0f26f2ab75c5dbc8f5a9f11c7fce05000ba4c2f53a7921d7dad90cf7f8fb4f935cd0ee1e6dc452a8166f9b118ed8acefd9f2ac7fb3e6eab
@@ -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,19 @@
1
+ ## [0.2.3]
2
+ * Fix DomainSearch doing post instead of get
3
+ ## [0.2.2]
4
+ * DomainSearch Response class
5
+
6
+ ## [0.2.1]
7
+ * DomainSearch fake example data
8
+
9
+ ## [0.2.0]
10
+ * DomainSearch
11
+
12
+ ## [0.1.1]
13
+
14
+ ### Fixed
15
+ * GetProspectsByEmail & GetProspectList to always return arrays when expecting one
16
+
1
17
  ## [0.1.0]
2
18
  * GetUserLists
3
19
  * GetProspectList
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2019 ShakaCode
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
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.last_id
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,52 @@
1
+ require 'active_support/core_ext/array'
2
+ require 'camel_snake_struct'
3
+
4
+ module Snov
5
+ class DomainSearch
6
+ Response = Class.new(CamelSnakeStruct)
7
+ Response.example(MultiJson.load(File.read("#{__dir__}/fake_client/get_v2_domain-emails-with-info.json")))
8
+ include Enumerable
9
+
10
+ attr_reader :client, :domain, :type, :limit
11
+
12
+ def initialize(domain:, type: 'all', limit: 10, last_id: 0, client: Snov.client)
13
+ @client = client
14
+ @domain = domain
15
+ @type = type
16
+ @limit = limit
17
+ @last_id = last_id
18
+ end
19
+
20
+ def each(&block)
21
+ raw_result.emails.each(&block)
22
+ end
23
+
24
+ def success
25
+ raw_result.success
26
+ end
27
+
28
+ def webmail
29
+ raw_result.webmail
30
+ end
31
+
32
+ def result
33
+ raw_result.result
34
+ end
35
+
36
+ def last_id
37
+ raw_result.last_id
38
+ end
39
+
40
+ def company_name
41
+ raw_result.company_name
42
+ end
43
+
44
+ def raw_result
45
+ @raw_result ||= Response.new(client.get("/v2/domain-emails-with-info",
46
+ 'lastId' => @last_id,
47
+ 'limit' => @limit,
48
+ 'type' => type.to_s,
49
+ 'domain' => domain.to_s))
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,21 @@
1
+ {
2
+ "success": true,
3
+ "domain": "octagon.com",
4
+ "webmail": false,
5
+ "result": 84,
6
+ "lastId": 1823487525,
7
+ "limit": 100,
8
+ "companyName": "Octagon",
9
+ "emails": [
10
+ {
11
+ "email": "ben.gillespie@octagon.com",
12
+ "firstName": "Ben",
13
+ "lastName": "Gillespie",
14
+ "position": "Senior Account Executive",
15
+ "sourcePage": "https://www.linkedin.com/pub/ben-gillespie/7/73/809",
16
+ "companyName": "Octagon",
17
+ "type": "prospect",
18
+ "status": "verified"
19
+ }
20
+ ]
21
+ }
@@ -60,7 +60,10 @@ module Snov
60
60
 
61
61
  attr_accessor :id, :name, :first_name, :last_name, :industry, :country, :locality, :success, :source
62
62
  attr_accessor :logo, :last_update_date, :message
63
- attr_reader :social, :current_jobs, :previous_jobs
63
+
64
+ def social
65
+ Array.wrap(@social)
66
+ end
64
67
 
65
68
  def social=(val)
66
69
  @social = Array.wrap(val).map do |rel|
@@ -68,12 +71,20 @@ module Snov
68
71
  end
69
72
  end
70
73
 
74
+ def current_jobs
75
+ Array.wrap(@current_jobs)
76
+ end
77
+
71
78
  def current_jobs=(val)
72
79
  @current_jobs = Array.wrap(val).map do |rel|
73
80
  Job.new(rel)
74
81
  end
75
82
  end
76
83
 
84
+ def previous_jobs
85
+ Array.wrap(@previous_jobs)
86
+ end
87
+
77
88
  def previous_jobs=(val)
78
89
  @previous_jobs = Array.wrap(val).map do |rel|
79
90
  Job.new(rel)
@@ -52,7 +52,11 @@ module Snov
52
52
  include ActiveModel::Model
53
53
 
54
54
  attr_accessor :id, :name, :first_name, :last_name, :industry, :country, :locality
55
- attr_reader :social, :current_job, :previous_job, :lists, :campaigns, :last_update_date
55
+ attr_reader :last_update_date
56
+
57
+ def social
58
+ Array.wrap(@social)
59
+ end
56
60
 
57
61
  def social=(val)
58
62
  @social = Array.wrap(val).map do |rel|
@@ -60,24 +64,40 @@ module Snov
60
64
  end
61
65
  end
62
66
 
67
+ def current_job
68
+ Array.wrap(@current_job)
69
+ end
70
+
63
71
  def current_job=(val)
64
72
  @current_job = Array.wrap(val).map do |rel|
65
73
  Job.new(rel)
66
74
  end
67
75
  end
68
76
 
77
+ def previous_job
78
+ Array.wrap(@previous_job)
79
+ end
80
+
69
81
  def previous_job=(val)
70
82
  @previous_job = Array.wrap(val).map do |rel|
71
83
  Job.new(rel)
72
84
  end
73
85
  end
74
86
 
87
+ def lists
88
+ Array.wrap(@lists)
89
+ end
90
+
75
91
  def lists=(val)
76
92
  @lists = Array.wrap(val).map do |rel|
77
93
  List.new(rel)
78
94
  end
79
95
  end
80
96
 
97
+ def campaigns
98
+ Array.wrap(@lists)
99
+ end
100
+
81
101
  def campaigns=(val)
82
102
  @campaigns = Array.wrap(val).map do |rel|
83
103
  OpenStruct.new(rel)
@@ -1,3 +1,3 @@
1
1
  module Snov
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.3"
3
3
  end
@@ -5,6 +5,7 @@ Gem::Specification.new do |spec|
5
5
  spec.version = Snov::VERSION
6
6
  spec.authors = ["Grant Petersen-Speelman"]
7
7
  spec.email = ["grantspeelman@gmail.com"]
8
+ spec.license = "MIT"
8
9
 
9
10
  spec.summary = %q{Snov client to interact with snov api}
10
11
  spec.description = %q{Snov client to interact with snov api}
@@ -23,8 +24,9 @@ Gem::Specification.new do |spec|
23
24
  spec.bindir = "exe"
24
25
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
25
26
  spec.require_paths = ["lib"]
26
- spec.add_dependency 'activemodel'
27
- spec.add_dependency 'activesupport'
28
- spec.add_dependency 'faraday'
29
- 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'
30
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.0
4
+ version: 0.2.3
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-28 00:00:00.000000000 Z
11
+ date: 2021-01-12 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
@@ -78,6 +122,7 @@ files:
78
122
  - ".rubocop.yml"
79
123
  - ".travis.yml"
80
124
  - CHANGELOG.md
125
+ - LICENSE
81
126
  - README.md
82
127
  - Rakefile
83
128
  - bin/console
@@ -87,8 +132,10 @@ files:
87
132
  - gems.rb
88
133
  - lib/snov.rb
89
134
  - lib/snov/client.rb
135
+ - lib/snov/domain_search.rb
90
136
  - lib/snov/fake_client.rb
91
137
  - lib/snov/fake_client/get_v1_get-user-lists.json
138
+ - lib/snov/fake_client/get_v2_domain-emails-with-info.json
92
139
  - lib/snov/fake_client/post_v1_get-profile-by-email.json
93
140
  - lib/snov/fake_client/post_v1_get-prospects-by-email.json
94
141
  - lib/snov/fake_client/post_v1_prospect-list.json
@@ -101,7 +148,8 @@ files:
101
148
  - lib/snov/version.rb
102
149
  - snov.gemspec
103
150
  homepage: https://github.com/NEXL-LTS/snov-ruby
104
- licenses: []
151
+ licenses:
152
+ - MIT
105
153
  metadata:
106
154
  homepage_uri: https://github.com/NEXL-LTS/snov-ruby
107
155
  source_code_uri: https://github.com/NEXL-LTS/snov-ruby