appending 1.4.3 → 1.5.1
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 +4 -4
- data/lib/appending.rb +43 -0
- metadata +22 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5f180b399c7b4d847779642193962a7c0b7cfd2653117b5119ab90e46811db01
|
|
4
|
+
data.tar.gz: 30442601831a4ab2fa7b0c1e464fcfb3a23b4513bc2edcf8629916f3f837aa80
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0bcd6dc16a0928662c3531d6050f96f5495ab132cae8a21f85dd4ee38182457c58d8b45862c7eef4dc1ea8c25bb153bbd1d01401858a34615720f90c1cff12ef
|
|
7
|
+
data.tar.gz: 35cb4224a1a090748389df264d18063d48411e2c778fe4fae623f69b222f2dc1ee1b5c30698de4c3f8eba4c786aaea62ee5393c6322c274ac72422e949b20b3c
|
data/lib/appending.rb
CHANGED
|
@@ -15,6 +15,8 @@ module BlackStack
|
|
|
15
15
|
@@company_domain_fields = []
|
|
16
16
|
|
|
17
17
|
@@zerobounce_api_key = nil
|
|
18
|
+
@@emailverify_api_key = nil
|
|
19
|
+
@@debounce_api_key = nil
|
|
18
20
|
|
|
19
21
|
## @@logger
|
|
20
22
|
def self.set_logger(logger)
|
|
@@ -167,6 +169,12 @@ module BlackStack
|
|
|
167
169
|
|
|
168
170
|
# zerobounce api key
|
|
169
171
|
@@zerobounce_api_key = h[:zerobounce_api_key] if h[:zerobounce_api_key]
|
|
172
|
+
|
|
173
|
+
# emailverify api key
|
|
174
|
+
@@emailverify_api_key = h[:emailverify_api_key] if h[:emailverify_api_key]
|
|
175
|
+
|
|
176
|
+
# debounce api key
|
|
177
|
+
@@debounce_api_key = h[:debounce_api_key] if h[:debounce_api_key]
|
|
170
178
|
end
|
|
171
179
|
|
|
172
180
|
# call zerobounce api
|
|
@@ -183,6 +191,41 @@ module BlackStack
|
|
|
183
191
|
JSON.parse(res.body)
|
|
184
192
|
end
|
|
185
193
|
|
|
194
|
+
# call emailverify api to verify an email
|
|
195
|
+
# reutrn 'ok' if the email is valid
|
|
196
|
+
def self.emailverify_verify(email)
|
|
197
|
+
# validation: email must be a string
|
|
198
|
+
raise "Invalid email: #{email.class}. Expected: String." if !email.is_a?(String)
|
|
199
|
+
url = "https://apps.emaillistverify.com/api/verifEmail"
|
|
200
|
+
params = {
|
|
201
|
+
:secret => @@emailverify_api_key,
|
|
202
|
+
:email => email,
|
|
203
|
+
}
|
|
204
|
+
res = BlackStack::Netting::call_get(url, params)
|
|
205
|
+
res.body
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
# call emailverify api to verify an email
|
|
209
|
+
# reutrn 'ok' if the email is valid
|
|
210
|
+
def self.debounce_verify(email)
|
|
211
|
+
# validation: email must be a string
|
|
212
|
+
raise "Invalid email: #{email.class}. Expected: String." if !email.is_a?(String)
|
|
213
|
+
url = "https://api.debounce.io/v1"
|
|
214
|
+
params = {
|
|
215
|
+
:api => @@debounce_api_key,
|
|
216
|
+
:email => email,
|
|
217
|
+
}
|
|
218
|
+
res = BlackStack::Netting::call_get(url, params)
|
|
219
|
+
h = JSON.parse(res.body)
|
|
220
|
+
#h['balance']
|
|
221
|
+
h['debounce']['code']
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
# call emailverify api to ask if there are credits
|
|
225
|
+
def self.emailverify_credits?
|
|
226
|
+
BlackStack::Appending.emailverify_verify('x') == 'error_credit'
|
|
227
|
+
end
|
|
228
|
+
|
|
186
229
|
# return true if the domain get any random address as valid
|
|
187
230
|
#
|
|
188
231
|
# This is a support method for the `append` methods.
|
metadata
CHANGED
|
@@ -1,15 +1,35 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: appending
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.5.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Leandro Daniel Sardi
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2023-
|
|
11
|
+
date: 2023-06-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: debouncer
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - "~>"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: 0.2.2
|
|
20
|
+
- - ">="
|
|
21
|
+
- !ruby/object:Gem::Version
|
|
22
|
+
version: 0.2.2
|
|
23
|
+
type: :runtime
|
|
24
|
+
prerelease: false
|
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
26
|
+
requirements:
|
|
27
|
+
- - "~>"
|
|
28
|
+
- !ruby/object:Gem::Version
|
|
29
|
+
version: 0.2.2
|
|
30
|
+
- - ">="
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: 0.2.2
|
|
13
33
|
- !ruby/object:Gem::Dependency
|
|
14
34
|
name: csv
|
|
15
35
|
requirement: !ruby/object:Gem::Requirement
|