emailhunter 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +14 -8
- data/lib/email_hunter/api.rb +8 -4
- data/lib/email_hunter/{exist.rb → verify.rb} +4 -4
- data/lib/email_hunter/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc31f283b37abc4701ee89f70239b12a2814abad
|
4
|
+
data.tar.gz: dfebe8deff09ce7b29cbe6e3ff9e31da2ce01558
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0a00653e3b4e40e66e4a50cd6576ae999e487127220cd53f6f78ae79263f3e3877ca527ac329c771a5c05df3f9b75588cd05c21b58e98134683caa90ab4079a
|
7
|
+
data.tar.gz: b2d84a7fecc6941f55713d0d9701e3e619ae32c4af5e1b6e707504dbe45c620612cb7fa724955a6fb0a7dcc86829e9c946484460e76aa908f11bf70b6c59b4be
|
data/README.md
CHANGED
@@ -42,19 +42,25 @@ result.webmail
|
|
42
42
|
result.emails
|
43
43
|
result.offset
|
44
44
|
```
|
45
|
-
|
46
|
-
|
47
|
-
## Email check API
|
48
|
-
Checks if a given email address has been found in our base and returns the sources.
|
45
|
+
## Email Verify API
|
46
|
+
Allows you to verify the deliverability of an email address.
|
49
47
|
```ruby
|
50
|
-
email_hunter.
|
48
|
+
email_hunter.verify('bonjour@firmapi.com')
|
51
49
|
```
|
52
50
|
|
53
|
-
## Accessing email
|
51
|
+
## Accessing email verify response
|
54
52
|
```ruby
|
55
53
|
result.status
|
56
54
|
result.email
|
57
|
-
result.
|
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
|
58
64
|
result.sources
|
59
65
|
```
|
60
66
|
|
@@ -64,7 +70,7 @@ Guesses the most likely email of a person from his first name, his last name and
|
|
64
70
|
email_hunter.generate('gmail.com', 'Davide', 'Santangelo')
|
65
71
|
```
|
66
72
|
|
67
|
-
## Accessing
|
73
|
+
## Accessing generate response
|
68
74
|
```ruby
|
69
75
|
result.status
|
70
76
|
result.email
|
data/lib/email_hunter/api.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
require 'uri'
|
2
2
|
|
3
3
|
require File.expand_path(File.join(File.dirname(__FILE__), 'search'))
|
4
|
-
require File.expand_path(File.join(File.dirname(__FILE__), 'exist'))
|
5
4
|
require File.expand_path(File.join(File.dirname(__FILE__), 'generate'))
|
5
|
+
require File.expand_path(File.join(File.dirname(__FILE__), 'verify'))
|
6
6
|
|
7
7
|
module EmailHunter
|
8
8
|
class Api
|
@@ -23,8 +23,12 @@ module EmailHunter
|
|
23
23
|
end
|
24
24
|
|
25
25
|
# Email Generate API
|
26
|
-
|
27
|
-
|
28
|
-
|
26
|
+
def generate(domain, first_name, last_name)
|
27
|
+
EmailHunter::Generate.new(domain, first_name, last_name, self.key).hunt
|
28
|
+
end
|
29
|
+
|
30
|
+
def verify(email)
|
31
|
+
EmailHunter::Verify.new(email, self.key).hunt
|
32
|
+
end
|
29
33
|
end
|
30
34
|
end
|
@@ -1,11 +1,11 @@
|
|
1
1
|
require 'faraday'
|
2
2
|
require 'json'
|
3
3
|
|
4
|
-
|
4
|
+
API_VERIFY_URL = 'https://api.emailhunter.co/v1/verify?'
|
5
5
|
|
6
6
|
module EmailHunter
|
7
|
-
class
|
8
|
-
attr_reader :status, :email, :
|
7
|
+
class Verify
|
8
|
+
attr_reader :status, :email, :result, :score, :regexp, :gibberish, :disposable, :webmail,:mx_records,:smtp_server, :smtp_check,:accept_all, :sources
|
9
9
|
|
10
10
|
def initialize(email, key)
|
11
11
|
@email = email
|
@@ -20,7 +20,7 @@ module EmailHunter
|
|
20
20
|
private
|
21
21
|
|
22
22
|
def apiresponse
|
23
|
-
url = URI.parse(URI.encode("#{
|
23
|
+
url = URI.parse(URI.encode("#{API_VERIFY_URL}email=#{@email}&api_key=#{@key}"))
|
24
24
|
response = Faraday.new(url).get
|
25
25
|
response.success? ? JSON.parse(response.body, {symbolize_names: true}) : []
|
26
26
|
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.
|
4
|
+
version: 0.4.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: 2015-
|
11
|
+
date: 2015-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -128,9 +128,9 @@ files:
|
|
128
128
|
- emailhunter.gemspec
|
129
129
|
- lib/email_hunter.rb
|
130
130
|
- lib/email_hunter/api.rb
|
131
|
-
- lib/email_hunter/exist.rb
|
132
131
|
- lib/email_hunter/generate.rb
|
133
132
|
- lib/email_hunter/search.rb
|
133
|
+
- lib/email_hunter/verify.rb
|
134
134
|
- lib/email_hunter/version.rb
|
135
135
|
- lib/emailhunter.rb
|
136
136
|
homepage:
|