snov 0.3.2 → 0.4.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: 7faf9e2f35034621c1431218b982ad536b36286982b5dcbe6cce5e88a167b5c8
4
- data.tar.gz: 733b376b869be78af8537a41e62405c4006e0ac2745f8c05c980522e21662ecf
3
+ metadata.gz: 7f589444e92f1101b625086d9e1d440952b52e1de3c9996183bc3908f7ec43c2
4
+ data.tar.gz: cd4df386dd42c6c4f8c226526c0f42145b24b2bcdafb59019c12c6a01c417afe
5
5
  SHA512:
6
- metadata.gz: de5cd49d6bc4a25101314ab0434510bcee7436ce25c574d8dfe46546516069b2f57322716d8b6c74e6740c917ec5753ba1d4c54eecb5a9e93b30b14d4f30aa20
7
- data.tar.gz: 72a08e7800eb9297ebd746ba7a19c75458a312ad6a1b271ec28c384bf384e33688134b5d041809d01da3b6ef2783b98d58c1c8e8c50a045e76f62948baa5deea
6
+ metadata.gz: 4e53b2ea16a6ca434adaee244620863510b245c2dd48fd379f806bbe4ccb82e1e424b8992a351b34789da00410889312205486ec8917c509165f16f3e7751a21
7
+ data.tar.gz: 338af6443df4e833f662934940a87e8dcb9ac43ffe7b9be6710c3a1c237e4ef2ce68196ff066d287e8f4cc508ee7207119746f4b0767d9477506d4fbbb28f21a
data/.rubocop.yml CHANGED
@@ -2,6 +2,7 @@ require:
2
2
  - rubocop-rspec
3
3
 
4
4
  AllCops:
5
+ TargetRubyVersion: 2.5
5
6
  SuggestExtensions: false
6
7
  NewCops: enable
7
8
  Exclude:
data/.travis.yml CHANGED
@@ -3,7 +3,7 @@ language: ruby
3
3
  gemfile: gems.rb
4
4
  cache: bundler
5
5
  rvm:
6
- - 2.4
6
+ - 2.5
7
7
  - 2.7
8
8
  before_install:
9
9
  - yes | gem update --system --force
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## [0.4.0]
2
+ * search prospect emails with /v1/get-emails-from-url
3
+
1
4
  ## [0.3.2]
2
5
  * increase snov timeout to 90 seconds
3
6
  ## [0.3.1]
data/README.md CHANGED
@@ -148,6 +148,40 @@ see https://snov.io/api#ViewProspectsInList
148
148
  end
149
149
  ```
150
150
 
151
+ ### GetEmailsBySocialUrl
152
+
153
+ convenience wrapper for `GetEmailsFromUrl` to get a prospect with social url e.g. linkedin profile url
154
+
155
+ see https://snov.io/api#GetEmailsFromUrl
156
+
157
+ ```ruby
158
+ prospect = Snov::GetEmailsBySocialUrl.new(url: "https://www.linkedin.com/in/john-doe-123456/").prospect
159
+
160
+ prospect.data.emails.each do |value|
161
+ puts value.email
162
+ puts value.status
163
+ end
164
+
165
+ prospect.data.previous_jobs.each do |value|
166
+ puts value.company_name
167
+ puts value.company_type
168
+ puts value.position
169
+ puts value.country
170
+ puts value.start_date
171
+ puts value.industry
172
+ puts value.size
173
+ end
174
+
175
+ prospect.data.current_jobs.each do |value|
176
+ puts value.company_name
177
+ puts value.company_type
178
+ puts value.position
179
+ puts value.country
180
+ puts value.start_date
181
+ puts value.industry
182
+ puts value.size
183
+ end
184
+ ```
151
185
 
152
186
  ## Development
153
187
 
data/lib/snov.rb CHANGED
@@ -24,4 +24,5 @@ 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/get_emails_by_social_url'
27
28
  require 'snov/domain_search'
@@ -0,0 +1,77 @@
1
+ module Snov
2
+ class GetEmailsBySocialUrl
3
+ attr_reader :client
4
+
5
+ def initialize(client: Snov.client, url:)
6
+ @client = client
7
+ @url = url
8
+ end
9
+
10
+ def prospect
11
+ @prospect ||= ProspectResult.new(raw_result)
12
+ end
13
+
14
+ def raw_result
15
+ @raw_result ||= client.post("/v1/get-emails-from-url", "url" => @url)
16
+ .deep_transform_keys! { |key| key.underscore }
17
+ end
18
+
19
+ class ProspectJob
20
+ include ActiveModel::Model
21
+
22
+ attr_accessor :company_name, :company_type, :position, :social_link, :site, :locality, :state,
23
+ :city, :street, :street2, :country, :start_date, :end_date, :postal, :founded, :size,
24
+ :industry
25
+ end
26
+
27
+ class ProspectJobList
28
+ include ActiveModel::Model
29
+ include Enumerable
30
+
31
+ attr_accessor :jobs
32
+
33
+ def each(&block)
34
+ jobs.each(&block)
35
+ end
36
+ end
37
+
38
+ class ProspectEmail
39
+ include ActiveModel::Model
40
+
41
+ attr_accessor :email, :status
42
+ end
43
+
44
+ class ProspectData
45
+ include ActiveModel::Model
46
+
47
+ attr_reader :emails, :previous_jobs, :current_jobs
48
+ attr_accessor :id, :name, :first_name, :last_name, :source_page, :source, :industry,
49
+ :country, :locality, :last_update_date, :social, :skills, :links
50
+
51
+ def emails=(val)
52
+ @emails = Array.wrap(val).map do |rel|
53
+ ProspectEmail.new(rel)
54
+ end
55
+ end
56
+
57
+ def previous_job=(val)
58
+ @previous_jobs = ProspectJobList.new(jobs: Array.wrap(val).map { |job| ProspectJob.new(job) })
59
+ end
60
+
61
+ def current_job=(val)
62
+ @current_jobs = ProspectJobList.new(jobs: Array.wrap(val).map { |job| ProspectJob.new(job) })
63
+ end
64
+ end
65
+
66
+ class ProspectResult
67
+ include ActiveModel::Model
68
+
69
+ attr_accessor :success, :message
70
+ attr_reader :data
71
+
72
+ def data=(val)
73
+ @data = ProspectData.new(val)
74
+ end
75
+ end
76
+ end
77
+ end
data/lib/snov/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Snov
2
- VERSION = "0.3.2"
2
+ VERSION = "0.4.0"
3
3
  end
data/snov.gemspec CHANGED
@@ -3,18 +3,18 @@ require_relative 'lib/snov/version'
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "snov"
5
5
  spec.version = Snov::VERSION
6
- spec.authors = ["Grant Petersen-Speelman"]
7
- spec.email = ["grantspeelman@gmail.com"]
6
+ spec.authors = ["Grant Petersen-Speelman", "Bapu Sethi"]
7
+ spec.email = ["grantspeelman@gmail.com", "bapu.sethi.03@gmail.com"]
8
8
  spec.license = "MIT"
9
9
 
10
10
  spec.summary = %q{Snov client to interact with snov api}
11
11
  spec.description = %q{Snov client to interact with snov api}
12
12
  spec.homepage = "https://github.com/NEXL-LTS/snov-ruby"
13
- spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
13
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
14
14
 
15
15
  spec.metadata["homepage_uri"] = spec.homepage
16
16
  spec.metadata["source_code_uri"] = "https://github.com/NEXL-LTS/snov-ruby"
17
- spec.metadata["changelog_uri"] = "https://github.com/NEXL-LTS/snov-ruby/CHANGELOG.md"
17
+ spec.metadata["changelog_uri"] = "https://github.com/NEXL-LTS/snov-ruby/blob/main/CHANGELOG.md"
18
18
 
19
19
  # Specify which files should be added to the gem when it is released.
20
20
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snov
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Grant Petersen-Speelman
8
- autorequire:
8
+ - Bapu Sethi
9
+ autorequire:
9
10
  bindir: exe
10
11
  cert_chain: []
11
- date: 2021-02-15 00:00:00.000000000 Z
12
+ date: 2021-05-11 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: activemodel
@@ -113,6 +114,7 @@ dependencies:
113
114
  description: Snov client to interact with snov api
114
115
  email:
115
116
  - grantspeelman@gmail.com
117
+ - bapu.sethi.03@gmail.com
116
118
  executables: []
117
119
  extensions: []
118
120
  extra_rdoc_files: []
@@ -145,6 +147,7 @@ files:
145
147
  - lib/snov/fake_client/post_v1_prospect-list/listId=1505383&page=1&perPage=100.json
146
148
  - lib/snov/fake_client/post_v1_prospect-list/listId=1818597&page=1&perPage=100.json
147
149
  - lib/snov/get_all_prospects_from_list.rb
150
+ - lib/snov/get_emails_by_social_url.rb
148
151
  - lib/snov/get_profile_by_email.rb
149
152
  - lib/snov/get_prospect_list.rb
150
153
  - lib/snov/get_prospects_by_email.rb
@@ -158,8 +161,8 @@ licenses:
158
161
  metadata:
159
162
  homepage_uri: https://github.com/NEXL-LTS/snov-ruby
160
163
  source_code_uri: https://github.com/NEXL-LTS/snov-ruby
161
- changelog_uri: https://github.com/NEXL-LTS/snov-ruby/CHANGELOG.md
162
- post_install_message:
164
+ changelog_uri: https://github.com/NEXL-LTS/snov-ruby/blob/main/CHANGELOG.md
165
+ post_install_message:
163
166
  rdoc_options: []
164
167
  require_paths:
165
168
  - lib
@@ -167,15 +170,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
167
170
  requirements:
168
171
  - - ">="
169
172
  - !ruby/object:Gem::Version
170
- version: 2.4.0
173
+ version: 2.5.0
171
174
  required_rubygems_version: !ruby/object:Gem::Requirement
172
175
  requirements:
173
176
  - - ">="
174
177
  - !ruby/object:Gem::Version
175
178
  version: '0'
176
179
  requirements: []
177
- rubygems_version: 3.1.4
178
- signing_key:
180
+ rubygems_version: 3.2.3
181
+ signing_key:
179
182
  specification_version: 4
180
183
  summary: Snov client to interact with snov api
181
184
  test_files: []