emailhunter 0.8.1 → 0.8.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/email_hunter.rb +3 -1
- data/lib/email_hunter/account.rb +6 -4
- data/lib/email_hunter/api.rb +10 -8
- data/lib/email_hunter/exist.rb +3 -1
- data/lib/email_hunter/finder.rb +3 -1
- data/lib/email_hunter/search.rb +4 -5
- data/lib/email_hunter/verify.rb +3 -1
- data/lib/email_hunter/version.rb +3 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 919a594154aeb435ac204b170a8799d8b1d4fb32c0b904274bbf4e7d2f35c07d
|
4
|
+
data.tar.gz: bbab42343b2c5de68957315eeb5ef2e4f8c24276d1ee162b7e3925eec32c919a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf92033afa890edd4b255d9c83510cdfba1a5ae3ec40afe97abfea46215a6e0bdab979909e79e6948f6ff6bf91d8615231964782bb1e955e798c312585d8fc09
|
7
|
+
data.tar.gz: 100cf2f8fe30f45001563cfe2ad37adb5653c7d91b3b323bc2d257a45e04c344037f4ea16ec2ff1b9de427ac59722d9596a4948640e240d21b7130d569f51595
|
data/lib/email_hunter.rb
CHANGED
@@ -1,8 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require File.expand_path(File.join(File.dirname(__FILE__), 'email_hunter/api'))
|
2
4
|
require File.expand_path(File.join(File.dirname(__FILE__), 'email_hunter/version'))
|
3
5
|
|
4
6
|
module EmailHunter
|
5
|
-
|
7
|
+
module_function
|
6
8
|
|
7
9
|
def new(key)
|
8
10
|
Api.new(key)
|
data/lib/email_hunter/account.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'faraday'
|
2
4
|
require 'json'
|
3
5
|
|
4
|
-
|
6
|
+
API_ACCOUNT_URL = 'https://api.hunter.io/v2/account?'
|
5
7
|
|
6
8
|
module EmailHunter
|
7
9
|
class Account
|
@@ -19,9 +21,9 @@ module EmailHunter
|
|
19
21
|
private
|
20
22
|
|
21
23
|
def apiresponse
|
22
|
-
url = URI.parse(URI.encode("#{
|
24
|
+
url = URI.parse(URI.encode("#{API_ACCOUNT_URL}&api_key=#{@key}"))
|
23
25
|
response = Faraday.new(url).get
|
24
|
-
response.success? ? JSON.parse(response.body, {symbolize_names: true}) : []
|
26
|
+
response.success? ? JSON.parse(response.body, { symbolize_names: true }) : []
|
25
27
|
end
|
26
28
|
end
|
27
|
-
end
|
29
|
+
end
|
data/lib/email_hunter/api.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'uri'
|
2
4
|
|
3
5
|
require File.expand_path(File.join(File.dirname(__FILE__), 'exist'))
|
@@ -11,28 +13,28 @@ module EmailHunter
|
|
11
13
|
class Api
|
12
14
|
attr_reader :key
|
13
15
|
|
14
|
-
|
15
|
-
|
16
|
-
|
16
|
+
def initialize(key)
|
17
|
+
@key = key
|
18
|
+
end
|
17
19
|
|
18
20
|
# Domain search API
|
19
21
|
def search(domain, params = {})
|
20
|
-
EmailHunter::Search.new(domain,
|
22
|
+
EmailHunter::Search.new(domain, key, params).hunt
|
21
23
|
end
|
22
24
|
|
23
25
|
# Email exist API
|
24
26
|
def exist(email)
|
25
|
-
EmailHunter::Exist.new(email,
|
27
|
+
EmailHunter::Exist.new(email, key).hunt
|
26
28
|
end
|
27
29
|
|
28
30
|
# Email verify API
|
29
31
|
def verify(email)
|
30
|
-
EmailHunter::Verify.new(email,
|
32
|
+
EmailHunter::Verify.new(email, key).hunt
|
31
33
|
end
|
32
34
|
|
33
35
|
# Email Finder API
|
34
36
|
def finder(domain, first_name, last_name)
|
35
|
-
EmailHunter::Finder.new(domain, first_name, last_name,
|
37
|
+
EmailHunter::Finder.new(domain, first_name, last_name, key).hunt
|
36
38
|
end
|
37
39
|
|
38
40
|
# Email Count API
|
@@ -42,7 +44,7 @@ module EmailHunter
|
|
42
44
|
|
43
45
|
# Account Information API
|
44
46
|
def account
|
45
|
-
EmailHunter::Account.new(
|
47
|
+
EmailHunter::Account.new(key).hunt
|
46
48
|
end
|
47
49
|
end
|
48
50
|
end
|
data/lib/email_hunter/exist.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'faraday'
|
2
4
|
require 'json'
|
3
5
|
|
@@ -22,7 +24,7 @@ module EmailHunter
|
|
22
24
|
def apiresponse
|
23
25
|
url = URI.parse(URI.encode("#{API_EXIST_URL}email=#{@email}&api_key=#{@key}"))
|
24
26
|
response = Faraday.new(url).get
|
25
|
-
response.success? ? JSON.parse(response.body, {symbolize_names: true}) : []
|
27
|
+
response.success? ? JSON.parse(response.body, { symbolize_names: true }) : []
|
26
28
|
end
|
27
29
|
end
|
28
30
|
end
|
data/lib/email_hunter/finder.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'faraday'
|
2
4
|
require 'json'
|
3
5
|
|
@@ -24,7 +26,7 @@ module EmailHunter
|
|
24
26
|
def apiresponse
|
25
27
|
url = URI.parse(URI.encode("#{API_FINDER_URL}domain=#{@domain}&first_name=#{@first_name}&last_name=#{@last_name}&api_key=#{@key}"))
|
26
28
|
response = Faraday.new(url).get
|
27
|
-
response.success? ? JSON.parse(response.body, {symbolize_names: true}) : []
|
29
|
+
response.success? ? JSON.parse(response.body, { symbolize_names: true }) : []
|
28
30
|
end
|
29
31
|
end
|
30
32
|
end
|
data/lib/email_hunter/search.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'faraday'
|
2
4
|
require 'json'
|
3
5
|
|
@@ -21,12 +23,9 @@ module EmailHunter
|
|
21
23
|
private
|
22
24
|
|
23
25
|
def apiresponse
|
24
|
-
url =
|
25
|
-
URI.parse(URI.encode(
|
26
|
-
"#{API_SEARCH_URL}domain=#{@domain}&api_key=#{@key}&type=#{@params[:type]}&offset=#{@params[:offset]}")
|
27
|
-
)
|
26
|
+
url = URI.parse(URI.encode("#{API_SEARCH_URL}domain=#{@domain}&api_key=#{@key}&type=#{@params[:type]}&offset=#{@params[:offset]}&limit=#{@params[:limit]}"))
|
28
27
|
response = Faraday.new(url).get
|
29
|
-
response.success? ? JSON.parse(response.body, {symbolize_names: true}) : []
|
28
|
+
response.success? ? JSON.parse(response.body, { symbolize_names: true }) : []
|
30
29
|
end
|
31
30
|
end
|
32
31
|
end
|
data/lib/email_hunter/verify.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'faraday'
|
2
4
|
require 'json'
|
3
5
|
|
@@ -22,7 +24,7 @@ module EmailHunter
|
|
22
24
|
def apiresponse
|
23
25
|
url = URI.parse(URI.encode("#{API_VERIFY_URL}email=#{@email}&api_key=#{@key}"))
|
24
26
|
response = Faraday.new(url).get
|
25
|
-
response.success? ? JSON.parse(response.body, {symbolize_names: true}) : []
|
27
|
+
response.success? ? JSON.parse(response.body, { symbolize_names: true }) : []
|
26
28
|
end
|
27
29
|
end
|
28
30
|
end
|
data/lib/email_hunter/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: emailhunter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Davide Santangelo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-04-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -156,7 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
156
156
|
- !ruby/object:Gem::Version
|
157
157
|
version: '0'
|
158
158
|
requirements: []
|
159
|
-
rubygems_version: 3.0.
|
159
|
+
rubygems_version: 3.0.8
|
160
160
|
signing_key:
|
161
161
|
specification_version: 4
|
162
162
|
summary: A tiny ruby wrapper around Email Hunter API
|