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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6212d2572b7b4291f9c6b0458869d2704bfd6b7a0e682808b841f9f6088f6aa8
4
- data.tar.gz: db1d5f7d367f74128d3a06684ac924fc0e2870dd34545571fd99f54ed36c181c
3
+ metadata.gz: 919a594154aeb435ac204b170a8799d8b1d4fb32c0b904274bbf4e7d2f35c07d
4
+ data.tar.gz: bbab42343b2c5de68957315eeb5ef2e4f8c24276d1ee162b7e3925eec32c919a
5
5
  SHA512:
6
- metadata.gz: '086b73b47ae012cbb1fbc66ce246085c47e9a921e17bd82a057349e340d17feadd8732b7d1dd1df191390f9f0c5cb7f4cd014bc947089c920034a38efc783974'
7
- data.tar.gz: af1d937ccc400bf39a688f92024b851696f5cfd6fb4d859bc70cf6542279f0d388b8330ed512be1a1d6a7b3523f0b910f4a85c0fb3c3f6ebc9a78e7912db7eb3
6
+ metadata.gz: bf92033afa890edd4b255d9c83510cdfba1a5ae3ec40afe97abfea46215a6e0bdab979909e79e6948f6ff6bf91d8615231964782bb1e955e798c312585d8fc09
7
+ data.tar.gz: 100cf2f8fe30f45001563cfe2ad37adb5653c7d91b3b323bc2d257a45e04c344037f4ea16ec2ff1b9de427ac59722d9596a4948640e240d21b7130d569f51595
@@ -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
- extend self
7
+ module_function
6
8
 
7
9
  def new(key)
8
10
  Api.new(key)
@@ -1,7 +1,9 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'faraday'
2
4
  require 'json'
3
5
 
4
- API_VERIFY_URL = 'https://api.hunter.io/v2/account?'
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("#{API_VERIFY_URL}&api_key=#{@key}"))
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
@@ -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
- def initialize(key)
15
- @key = key
16
- end
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, self.key, params).hunt
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, self.key).hunt
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, self.key).hunt
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, self.key).hunt
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(self.key).hunt
47
+ EmailHunter::Account.new(key).hunt
46
48
  end
47
49
  end
48
50
  end
@@ -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
@@ -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
@@ -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
@@ -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
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module EmailHunter
2
- VERSION = "0.8.1"
4
+ VERSION = '0.8.3'
3
5
  end
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.1
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: 2019-11-21 00:00:00.000000000 Z
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.2
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