snov 0.4.1 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.byebug_history +5 -0
- data/README.md +15 -0
- data/lib/snov.rb +1 -0
- data/lib/snov/get_emails_from_name.rb +68 -0
- data/lib/snov/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 29a980f1ec57e85a5f0fbf089fdcb646e5a66454c91515d90e33b7aaec042ac6
|
4
|
+
data.tar.gz: 17e52baa847e7f42eba8696e35509f7478582696092a8e0cd229cf108c097d5c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ce75c52ecf8c7bd180ad2a2b4ea510acb494b59060f779424c0d5db7888ca18c75d9eb16ed8b66b58e46555a193e89f41b8df760177f0bd70f6076e3b94a9b9
|
7
|
+
data.tar.gz: 41e171a1eaa943b01e82369979939f2f28523ed3a2835029453918965b324946a1507e8dae64df88980e603073d50d8d9c1de9612fd9f0017745cfca96733e0b
|
data/.byebug_history
ADDED
data/README.md
CHANGED
@@ -183,6 +183,21 @@ see https://snov.io/api#GetEmailsFromUrl
|
|
183
183
|
end
|
184
184
|
```
|
185
185
|
|
186
|
+
### GetEmailsFromName
|
187
|
+
|
188
|
+
convenience wrapper for `GetEmailsFromName` to get a prospect with name
|
189
|
+
|
190
|
+
see https://snov.io/api#EmailFinder
|
191
|
+
|
192
|
+
```ruby
|
193
|
+
prospect = Snov::GetEmailsFromName.new(first_name: "gavin", last_name: "vanrooyen", domain: "octagon.com").prospect
|
194
|
+
|
195
|
+
prospect.data.emails.each do |value|
|
196
|
+
puts value.email
|
197
|
+
puts value.email_status
|
198
|
+
end
|
199
|
+
```
|
200
|
+
|
186
201
|
## Development
|
187
202
|
|
188
203
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/rspec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/lib/snov.rb
CHANGED
@@ -0,0 +1,68 @@
|
|
1
|
+
module Snov
|
2
|
+
class GetEmailsFromName
|
3
|
+
attr_reader :client
|
4
|
+
|
5
|
+
def initialize(client: Snov.client, first_name:, last_name:, domain:)
|
6
|
+
@client = client
|
7
|
+
@first_name = first_name
|
8
|
+
@last_name = last_name
|
9
|
+
@domain = domain
|
10
|
+
end
|
11
|
+
|
12
|
+
def prospect
|
13
|
+
@prospect ||= ProspectResult.new(raw_result)
|
14
|
+
end
|
15
|
+
|
16
|
+
def raw_result
|
17
|
+
@raw_result ||= client.post("/v1/get-emails-from-names",
|
18
|
+
"firstName" => @first_name,
|
19
|
+
"lastName" => @last_name,
|
20
|
+
"domain" => @domain)
|
21
|
+
.deep_transform_keys! { |key| key.underscore }
|
22
|
+
end
|
23
|
+
|
24
|
+
class ProspectData
|
25
|
+
include ActiveModel::Model
|
26
|
+
|
27
|
+
attr_accessor :first_name, :last_name
|
28
|
+
attr_reader :emails
|
29
|
+
|
30
|
+
def emails=(val)
|
31
|
+
@emails = Array.wrap(val).map do |rel|
|
32
|
+
ProspectEmail.new(rel)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
class ProspectEmail
|
38
|
+
include ActiveModel::Model
|
39
|
+
|
40
|
+
attr_accessor :email, :email_status
|
41
|
+
end
|
42
|
+
|
43
|
+
class ProspectStatus
|
44
|
+
include ActiveModel::Model
|
45
|
+
|
46
|
+
attr_accessor :identifier, :description
|
47
|
+
|
48
|
+
def completed?
|
49
|
+
identifier == 'complete'
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
class ProspectResult
|
54
|
+
include ActiveModel::Model
|
55
|
+
|
56
|
+
attr_accessor :success, :message, :params
|
57
|
+
attr_reader :data, :status
|
58
|
+
|
59
|
+
def data=(val)
|
60
|
+
@data = ProspectData.new(val)
|
61
|
+
end
|
62
|
+
|
63
|
+
def status=(val)
|
64
|
+
@status = ProspectStatus.new(val)
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
data/lib/snov/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: snov
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Grant Petersen-Speelman
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2021-
|
12
|
+
date: 2021-06-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activemodel
|
@@ -119,6 +119,7 @@ executables: []
|
|
119
119
|
extensions: []
|
120
120
|
extra_rdoc_files: []
|
121
121
|
files:
|
122
|
+
- ".byebug_history"
|
122
123
|
- ".gitignore"
|
123
124
|
- ".rspec"
|
124
125
|
- ".rubocop.yml"
|
@@ -148,6 +149,7 @@ files:
|
|
148
149
|
- lib/snov/fake_client/post_v1_prospect-list/listId=1818597&page=1&perPage=100.json
|
149
150
|
- lib/snov/get_all_prospects_from_list.rb
|
150
151
|
- lib/snov/get_emails_by_social_url.rb
|
152
|
+
- lib/snov/get_emails_from_name.rb
|
151
153
|
- lib/snov/get_profile_by_email.rb
|
152
154
|
- lib/snov/get_prospect_list.rb
|
153
155
|
- lib/snov/get_prospects_by_email.rb
|
@@ -177,7 +179,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
177
179
|
- !ruby/object:Gem::Version
|
178
180
|
version: '0'
|
179
181
|
requirements: []
|
180
|
-
rubygems_version: 3.2.
|
182
|
+
rubygems_version: 3.2.15
|
181
183
|
signing_key:
|
182
184
|
specification_version: 4
|
183
185
|
summary: Snov client to interact with snov api
|