emailhunter 0.7.1 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +29 -0
- data/lib/email_hunter/account.rb +27 -0
- data/lib/email_hunter/api.rb +7 -0
- data/lib/email_hunter/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: a874f0d9d9c2cb972daf51e46bb06f3635956577482f3d7ce52aac34d1f336ae
|
4
|
+
data.tar.gz: b579502b7f44f449a8df51ec604e04b25a5268149ffd4bfec6af64af03eeb0d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 82480b37bf3bea964b41c014dd4f73c4bd04022238bdee404077d448fac83a664c25314cf014c5b93ce44d7f39d621df5ea711a3152868c0a7999ef82eac13fa
|
7
|
+
data.tar.gz: c15f4cfc1fe641446c2b0aacf0862327f3f1568bf791cc77c27165c518ab7a2a67b810e3058ea0b9b6f946b0d3c481677abb6d0b9166c149fbeddfaebdf587e5
|
data/README.md
CHANGED
@@ -109,6 +109,35 @@ result.fetch(:data)
|
|
109
109
|
result.fetch(:meta)
|
110
110
|
```
|
111
111
|
|
112
|
+
## Account Information
|
113
|
+
This method enables you to get information regarding your Hunter account at any time. This call is free.
|
114
|
+
```ruby
|
115
|
+
email_hunter.account
|
116
|
+
```
|
117
|
+
|
118
|
+
## Accessing account response
|
119
|
+
```ruby
|
120
|
+
result.fetch(:data)
|
121
|
+
```
|
122
|
+
|
123
|
+
```json
|
124
|
+
{
|
125
|
+
"data":{
|
126
|
+
"first_name":"Davide",
|
127
|
+
"last_name":"Santangelo",
|
128
|
+
"email":"davide.santangelo@gmail.com",
|
129
|
+
"plan_name":"Free",
|
130
|
+
"plan_level":0,
|
131
|
+
"reset_date":"2019-06-29",
|
132
|
+
"team_id":349,
|
133
|
+
"calls":{
|
134
|
+
"used":4,
|
135
|
+
"available":50
|
136
|
+
}
|
137
|
+
}
|
138
|
+
}
|
139
|
+
```
|
140
|
+
|
112
141
|
## License
|
113
142
|
The emailhunter GEM is released under the MIT License.
|
114
143
|
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'faraday'
|
2
|
+
require 'json'
|
3
|
+
|
4
|
+
API_VERIFY_URL = 'https://api.hunter.io/v2/account?'
|
5
|
+
|
6
|
+
module EmailHunter
|
7
|
+
class Account
|
8
|
+
attr_reader :result, :first_name, :last_name, :email, :plan_name, :plan_level, :reset_date, :team_id, :calls
|
9
|
+
|
10
|
+
def initialize(key)
|
11
|
+
@key = key
|
12
|
+
end
|
13
|
+
|
14
|
+
def hunt
|
15
|
+
response = apiresponse
|
16
|
+
Struct.new(*response.keys).new(*response.values) unless response.empty?
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def apiresponse
|
22
|
+
url = URI.parse(URI.encode("#{API_VERIFY_URL}&api_key=#{@key}"))
|
23
|
+
response = Faraday.new(url).get
|
24
|
+
response.success? ? JSON.parse(response.body, {symbolize_names: true}) : []
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
data/lib/email_hunter/api.rb
CHANGED
@@ -5,6 +5,7 @@ require File.expand_path(File.join(File.dirname(__FILE__), 'search'))
|
|
5
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
|
+
require File.expand_path(File.join(File.dirname(__FILE__), 'account'))
|
8
9
|
|
9
10
|
module EmailHunter
|
10
11
|
class Api
|
@@ -34,8 +35,14 @@ module EmailHunter
|
|
34
35
|
EmailHunter::Finder.new(domain, first_name, last_name, self.key).hunt
|
35
36
|
end
|
36
37
|
|
38
|
+
# Email Count API
|
37
39
|
def count(domain)
|
38
40
|
EmailHunter::Count.new(domain).hunt
|
39
41
|
end
|
42
|
+
|
43
|
+
# Account Information API
|
44
|
+
def account
|
45
|
+
EmailHunter::Account.new(self.key).hunt
|
46
|
+
end
|
40
47
|
end
|
41
48
|
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.8.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:
|
11
|
+
date: 2019-06-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -128,6 +128,7 @@ files:
|
|
128
128
|
- bin/setup
|
129
129
|
- emailhunter.gemspec
|
130
130
|
- lib/email_hunter.rb
|
131
|
+
- lib/email_hunter/account.rb
|
131
132
|
- lib/email_hunter/api.rb
|
132
133
|
- lib/email_hunter/count.rb
|
133
134
|
- lib/email_hunter/exist.rb
|
@@ -155,8 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
155
156
|
- !ruby/object:Gem::Version
|
156
157
|
version: '0'
|
157
158
|
requirements: []
|
158
|
-
|
159
|
-
rubygems_version: 2.6.10
|
159
|
+
rubygems_version: 3.0.2
|
160
160
|
signing_key:
|
161
161
|
specification_version: 4
|
162
162
|
summary: A tiny ruby wrapper around Email Hunter API
|