emailhunter 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.vscode/settings.json +4 -0
- data/README.md +29 -27
- data/lib/email_hunter/api.rb +4 -4
- data/lib/email_hunter/count.rb +2 -2
- data/lib/email_hunter/{generate.rb → finder.rb} +6 -6
- data/lib/email_hunter/search.rb +2 -2
- data/lib/email_hunter/verify.rb +2 -2
- data/lib/email_hunter/version.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5649b149285da261df828fc1faa48468ddba599a
|
4
|
+
data.tar.gz: 953e44628f3ad974a8930ca1792905aac18d1dbe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa4d396e04403eed1c426cdba4dd861f5cc37d6c85613db4c8b1af308098d091c1ec127fc934d04cc73beaa998c567ff2886ca2e78db65da0d8095fd61b11e86
|
7
|
+
data.tar.gz: 0d4892f947e75fe9ff8d21b8a41e5e9de4bfb80c9751d77136a96e1e49bb056df55d206218f3616d9a92b05f426441788381260f25ab2d3cd107b355db1e45c0
|
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.
|
40
|
-
result.
|
41
|
-
result.
|
42
|
-
result.
|
43
|
-
result.
|
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.
|
54
|
-
result.
|
55
|
-
result.
|
56
|
-
result.
|
57
|
-
result.
|
58
|
-
result.
|
59
|
-
result.
|
60
|
-
result.
|
61
|
-
result.
|
62
|
-
result.
|
63
|
-
result.
|
64
|
-
|
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
|
-
##
|
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.
|
89
|
+
email_hunter.finder('gmail.com', 'Davide', 'Santangelo')
|
89
90
|
```
|
90
|
-
|
91
|
-
## Accessing generate response
|
91
|
+
## Accessing finder response
|
92
92
|
```ruby
|
93
|
-
result.
|
94
|
-
result.
|
95
|
-
result.
|
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.
|
107
|
-
result.
|
108
|
+
result.fetch(:data)
|
109
|
+
result.fetch(:meta)
|
108
110
|
```
|
109
111
|
|
110
112
|
## License
|
data/lib/email_hunter/api.rb
CHANGED
@@ -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__), '
|
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
|
33
|
-
def
|
34
|
-
EmailHunter::
|
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)
|
data/lib/email_hunter/count.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
require 'faraday'
|
2
2
|
require 'json'
|
3
3
|
|
4
|
-
API_COUNT_URL = 'https://api.emailhunter.co/
|
4
|
+
API_COUNT_URL = 'https://api.emailhunter.co/v2/email-count?'
|
5
5
|
|
6
6
|
module EmailHunter
|
7
7
|
class Count
|
8
|
-
attr_reader :
|
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
|
-
|
4
|
+
API_FINDER_URL = 'https://api.hunter.io/v2/email-finder?'
|
5
5
|
|
6
6
|
module EmailHunter
|
7
|
-
class
|
8
|
-
attr_reader :
|
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("#{
|
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
|
data/lib/email_hunter/search.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
require 'faraday'
|
2
2
|
require 'json'
|
3
3
|
|
4
|
-
API_SEARCH_URL = 'https://api.emailhunter.co/
|
4
|
+
API_SEARCH_URL = 'https://api.emailhunter.co/v2/domain-search?'
|
5
5
|
|
6
6
|
module EmailHunter
|
7
7
|
class Search
|
8
|
-
attr_reader :
|
8
|
+
attr_reader :meta, :webmail, :emails, :pattern, :domain
|
9
9
|
|
10
10
|
def initialize(domain, key, params = {})
|
11
11
|
@domain = domain
|
data/lib/email_hunter/verify.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
require 'faraday'
|
2
2
|
require 'json'
|
3
3
|
|
4
|
-
API_VERIFY_URL = 'https://api.emailhunter.co/
|
4
|
+
API_VERIFY_URL = 'https://api.emailhunter.co/v2/email-verifier?'
|
5
5
|
|
6
6
|
module EmailHunter
|
7
7
|
class Verify
|
8
|
-
attr_reader :
|
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
|
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.
|
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
|
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/
|
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.
|
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
|