emailhunter 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6253d641337b4e60eba9a4f104f23a1043b4215f
4
- data.tar.gz: 645f662f4ad60db251f642bfabcdfb50a7223d4c
3
+ metadata.gz: 5649b149285da261df828fc1faa48468ddba599a
4
+ data.tar.gz: 953e44628f3ad974a8930ca1792905aac18d1dbe
5
5
  SHA512:
6
- metadata.gz: 4f6aa7e7d2a1add576bd974192766e3cb0328f3b90ddcd91ae6dfb238af6c788a553665a84b6806bd1bff58eaacb5e58672292a66173122e78b749f56367efbe
7
- data.tar.gz: ec2fd520126b3113320567510983740429d127f202ddae6fe93b004e3de385477ef6eaf2c1ba5ae607df6113a1633395e5e0612444f996a4c1f519920641c362
6
+ metadata.gz: aa4d396e04403eed1c426cdba4dd861f5cc37d6c85613db4c8b1af308098d091c1ec127fc934d04cc73beaa998c567ff2886ca2e78db65da0d8095fd61b11e86
7
+ data.tar.gz: 0d4892f947e75fe9ff8d21b8a41e5e9de4bfb80c9751d77136a96e1e49bb056df55d206218f3616d9a92b05f426441788381260f25ab2d3cd107b355db1e45c0
@@ -0,0 +1,4 @@
1
+ // Place your settings in this file to overwrite default and user settings.
2
+ {
3
+ "editor.tabSize": 2
4
+ }
data/README.md CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  A tiny ruby wrapper around Email Hunter API. Direct access to all the web's email addresses.
4
4
 
5
+ UPDATE (2016-12-02): gem updated with V2 API.
5
6
 
6
7
  ## Installation
7
8
 
@@ -36,11 +37,11 @@ result = email_hunter.search('stripe.com')
36
37
 
37
38
  ## Accessing domain search response
38
39
  ```ruby
39
- result.status
40
- result.results
41
- result.webmail
42
- result.emails
43
- result.offset
40
+ result.fetch(:meta)
41
+ result.fetch(:webmail)
42
+ result.fetch(:emails)
43
+ result.fetch(:pattern)
44
+ result.fetch(:domain)
44
45
  ```
45
46
  ## Email Verify API
46
47
  Allows you to verify the deliverability of an email address.
@@ -50,21 +51,21 @@ email_hunter.verify('bonjour@firmapi.com')
50
51
 
51
52
  ## Accessing email verify response
52
53
  ```ruby
53
- result.status
54
- result.email
55
- result.score
56
- result.regexp
57
- result.gibberish
58
- result.disposable
59
- result.webmail
60
- result.mx_records
61
- result.smtp_server
62
- result.smtp_check
63
- result.accept_all
64
- result.sources
54
+ result.fetch(:result)
55
+ result.fetch(:score)
56
+ result.fetch(:regexp)
57
+ result.fetch(:gibberish)
58
+ result.fetch(:disposable)
59
+ result.fetch(:mx_records)
60
+ result.fetch(:smtp_server)
61
+ result.fetch(:smtp_check)
62
+ result.fetch(:accept_all)
63
+ result.fetch(:sources)
64
+ result.fetch(:meta)
65
+
65
66
  ```
66
67
 
67
- ## Email Exist API
68
+ ## Email Exist API (only for V1)
68
69
  This API call is deprecated, please use the email verification call instead.
69
70
 
70
71
 
@@ -82,17 +83,18 @@ result.exist
82
83
  result.sources
83
84
  ```
84
85
 
85
- ## Generate API
86
+ ## Finder API (legacy generate)
86
87
  Guesses the most likely email of a person from his first name, his last name and a domain name.
87
88
  ```ruby
88
- email_hunter.generate('gmail.com', 'Davide', 'Santangelo')
89
+ email_hunter.finder('gmail.com', 'Davide', 'Santangelo')
89
90
  ```
90
-
91
- ## Accessing generate response
91
+ ## Accessing finder response
92
92
  ```ruby
93
- result.status
94
- result.email
95
- result.score
93
+ result.fetch(:email)
94
+ result.fetch(:score)
95
+ result.fetch(:sources)
96
+ result.fetch(:domain)
97
+ result.fetch(:meta)
96
98
  ```
97
99
 
98
100
  ## Count API
@@ -103,8 +105,8 @@ email_hunter.count('gmail.com')
103
105
 
104
106
  ## Accessing count response
105
107
  ```ruby
106
- result.status
107
- result.count
108
+ result.fetch(:data)
109
+ result.fetch(:meta)
108
110
  ```
109
111
 
110
112
  ## License
@@ -2,7 +2,7 @@ require 'uri'
2
2
 
3
3
  require File.expand_path(File.join(File.dirname(__FILE__), 'exist'))
4
4
  require File.expand_path(File.join(File.dirname(__FILE__), 'search'))
5
- require File.expand_path(File.join(File.dirname(__FILE__), 'generate'))
5
+ require File.expand_path(File.join(File.dirname(__FILE__), 'finder'))
6
6
  require File.expand_path(File.join(File.dirname(__FILE__), 'verify'))
7
7
  require File.expand_path(File.join(File.dirname(__FILE__), 'count'))
8
8
 
@@ -29,9 +29,9 @@ module EmailHunter
29
29
  EmailHunter::Verify.new(email, self.key).hunt
30
30
  end
31
31
 
32
- # Email Generate API
33
- def generate(domain, first_name, last_name)
34
- EmailHunter::Generate.new(domain, first_name, last_name, self.key).hunt
32
+ # Email Finder API
33
+ def finder(domain, first_name, last_name)
34
+ EmailHunter::Finder.new(domain, first_name, last_name, self.key).hunt
35
35
  end
36
36
 
37
37
  def count(domain)
@@ -1,11 +1,11 @@
1
1
  require 'faraday'
2
2
  require 'json'
3
3
 
4
- API_COUNT_URL = 'https://api.emailhunter.co/v1/email-count?'
4
+ API_COUNT_URL = 'https://api.emailhunter.co/v2/email-count?'
5
5
 
6
6
  module EmailHunter
7
7
  class Count
8
- attr_reader :status, :count
8
+ attr_reader :data, :meta
9
9
 
10
10
  def initialize(domain)
11
11
  @domain = domain
@@ -1,16 +1,16 @@
1
1
  require 'faraday'
2
2
  require 'json'
3
3
 
4
- API_GENERATE_URL = 'https://api.emailhunter.co/v1/generate?'
4
+ API_FINDER_URL = 'https://api.hunter.io/v2/email-finder?'
5
5
 
6
6
  module EmailHunter
7
- class Generate
8
- attr_reader :status, :email, :score
7
+ class Finder
8
+ attr_reader :email, :score, :sources, :domain, :meta
9
9
 
10
10
  def initialize(domain, first_name, last_name, key)
11
+ @domain = domain
11
12
  @first_name = first_name
12
13
  @last_name = last_name
13
- @domain = domain
14
14
  @key = key
15
15
  end
16
16
 
@@ -22,9 +22,9 @@ module EmailHunter
22
22
  private
23
23
 
24
24
  def apiresponse
25
- url = URI.parse(URI.encode("#{API_GENERATE_URL}domain=#{@domain}&first_name=#{@first_name}&last_name=#{@last_name}&api_key=#{@key}"))
25
+ url = URI.parse(URI.encode("#{API_FINDER_URL}domain=#{@domain}&first_name=#{@first_name}&last_name=#{@last_name}&api_key=#{@key}"))
26
26
  response = Faraday.new(url).get
27
27
  response.success? ? JSON.parse(response.body, {symbolize_names: true}) : []
28
28
  end
29
29
  end
30
- end
30
+ end
@@ -1,11 +1,11 @@
1
1
  require 'faraday'
2
2
  require 'json'
3
3
 
4
- API_SEARCH_URL = 'https://api.emailhunter.co/v1/search?'
4
+ API_SEARCH_URL = 'https://api.emailhunter.co/v2/domain-search?'
5
5
 
6
6
  module EmailHunter
7
7
  class Search
8
- attr_reader :status, :results, :webmail, :emails, :offset
8
+ attr_reader :meta, :webmail, :emails, :pattern, :domain
9
9
 
10
10
  def initialize(domain, key, params = {})
11
11
  @domain = domain
@@ -1,11 +1,11 @@
1
1
  require 'faraday'
2
2
  require 'json'
3
3
 
4
- API_VERIFY_URL = 'https://api.emailhunter.co/v1/verify?'
4
+ API_VERIFY_URL = 'https://api.emailhunter.co/v2/email-verifier?'
5
5
 
6
6
  module EmailHunter
7
7
  class Verify
8
- attr_reader :status, :email, :result, :score, :regexp, :gibberish, :disposable, :webmail,:mx_records,:smtp_server, :smtp_check,:accept_all, :sources
8
+ attr_reader :result, :score, :regexp, :gibberish, :disposable, :webmail, :mx_records, :smtp_server, :smtp_check, :accept_all, :sources, :meta
9
9
 
10
10
  def initialize(email, key)
11
11
  @email = email
@@ -1,3 +1,3 @@
1
1
  module EmailHunter
2
- VERSION = "0.6.0"
2
+ VERSION = "0.7.0"
3
3
  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.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Davide Santangelo
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-02-06 00:00:00.000000000 Z
11
+ date: 2016-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -119,6 +119,7 @@ files:
119
119
  - ".gitignore"
120
120
  - ".rspec"
121
121
  - ".travis.yml"
122
+ - ".vscode/settings.json"
122
123
  - Gemfile
123
124
  - LICENSE
124
125
  - README.md
@@ -130,7 +131,7 @@ files:
130
131
  - lib/email_hunter/api.rb
131
132
  - lib/email_hunter/count.rb
132
133
  - lib/email_hunter/exist.rb
133
- - lib/email_hunter/generate.rb
134
+ - lib/email_hunter/finder.rb
134
135
  - lib/email_hunter/search.rb
135
136
  - lib/email_hunter/verify.rb
136
137
  - lib/email_hunter/version.rb
@@ -155,7 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
155
156
  version: '0'
156
157
  requirements: []
157
158
  rubyforge_project:
158
- rubygems_version: 2.4.8
159
+ rubygems_version: 2.6.8
159
160
  signing_key:
160
161
  specification_version: 4
161
162
  summary: A tiny ruby wrapper around Email Hunter API