clearbit 0.2.7 → 0.2.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +21 -0
- data/examples/name_domain.rb +4 -0
- data/examples/reveal.rb +11 -0
- data/examples/risk.rb +13 -0
- data/examples/risk_flag.rb +35 -0
- data/lib/clearbit.rb +2 -1
- data/lib/clearbit/enrichment.rb +1 -0
- data/lib/clearbit/enrichment/news.rb +18 -0
- data/lib/clearbit/name_domain.rb +17 -0
- data/lib/clearbit/risk.rb +1 -1
- data/lib/clearbit/version.rb +1 -1
- metadata +10 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9bfa4e2e52a22c81346477b50bbd5d4152abf27a
|
4
|
+
data.tar.gz: 0ddaa5a863838daf609679587149fdc32ee9af40
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f1a861b55adb44a91ac887d53099166336e3373ffe48d945806c5d83f86f091b2fc8e0f6cb123160b2f09e6580377fd2dd92353d79c2338aa957f6269e7a1c7
|
7
|
+
data.tar.gz: bfa3ffd82393968ae7e736d2e4bcee05acbb18b0a17413fcd6262aff1810f80187ba3c9df0585ce720aa9fc11f184ec441336ee04cede5f9a5aa72cbd6f0f510
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2017 Clearbit.
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/examples/reveal.rb
ADDED
data/examples/risk.rb
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'clearbit'
|
2
|
+
require 'pp'
|
3
|
+
require 'optparse'
|
4
|
+
|
5
|
+
options = {}
|
6
|
+
OptionParser.new do |opts|
|
7
|
+
opts.banner = "Usage: risk_flag.rb [options]"
|
8
|
+
|
9
|
+
opts.on("-iIP", "--ip=IP", "IP address") do |ip|
|
10
|
+
options[:ip] = ip
|
11
|
+
end
|
12
|
+
|
13
|
+
opts.on("-eEMAIL", "--email=EMAIL", "Email address") do |email|
|
14
|
+
options[:email] = email
|
15
|
+
end
|
16
|
+
|
17
|
+
opts.on("-tTYPE", "--type=TYPE", "Type") do |type|
|
18
|
+
options[:type] = type
|
19
|
+
end
|
20
|
+
|
21
|
+
opts.on("-h", "--help", "Prints this help") do
|
22
|
+
puts opts
|
23
|
+
exit
|
24
|
+
end
|
25
|
+
end.parse!
|
26
|
+
|
27
|
+
options[:type] ||= 'spam'
|
28
|
+
|
29
|
+
begin
|
30
|
+
Clearbit::Risk.flag(options)
|
31
|
+
rescue Nestful::Error => err
|
32
|
+
pp err.decoded
|
33
|
+
else
|
34
|
+
puts 'Successfully flagged!'
|
35
|
+
end
|
data/lib/clearbit.rb
CHANGED
@@ -20,10 +20,11 @@ module Clearbit
|
|
20
20
|
|
21
21
|
autoload :Autocomplete, 'clearbit/autocomplete'
|
22
22
|
autoload :Base, 'clearbit/base'
|
23
|
-
autoload :Enrichment, 'clearbit/enrichment'
|
24
23
|
autoload :Discovery, 'clearbit/discovery'
|
24
|
+
autoload :Enrichment, 'clearbit/enrichment'
|
25
25
|
autoload :Logo, 'clearbit/logo'
|
26
26
|
autoload :Mash, 'clearbit/mash'
|
27
|
+
autoload :NameDomain, 'clearbit/name_domain'
|
27
28
|
autoload :Pending, 'clearbit/pending'
|
28
29
|
autoload :Prospector, 'clearbit/prospector'
|
29
30
|
autoload :Resource, 'clearbit/resource'
|
data/lib/clearbit/enrichment.rb
CHANGED
@@ -0,0 +1,18 @@
|
|
1
|
+
module Clearbit
|
2
|
+
module Enrichment
|
3
|
+
class News < Base
|
4
|
+
endpoint 'https://company.clearbit.com'
|
5
|
+
path '/v1/news'
|
6
|
+
|
7
|
+
def self.articles(values)
|
8
|
+
if values.key?(:domain)
|
9
|
+
response = get(uri(:articles), values)
|
10
|
+
else
|
11
|
+
raise ArgumentError, 'Invalid values'
|
12
|
+
end
|
13
|
+
|
14
|
+
new(response)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Clearbit
|
2
|
+
class NameDomain < Base
|
3
|
+
endpoint 'https://company.clearbit.com'
|
4
|
+
path '/v1/domains'
|
5
|
+
|
6
|
+
def self.find(values)
|
7
|
+
response = get(uri(:find), values)
|
8
|
+
Mash.new(response.decoded)
|
9
|
+
rescue Nestful::ResourceNotFound
|
10
|
+
end
|
11
|
+
|
12
|
+
class << self
|
13
|
+
alias_method :[], :find
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
data/lib/clearbit/risk.rb
CHANGED
data/lib/clearbit/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: clearbit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex MacCaw
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-10-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -131,6 +131,7 @@ extra_rdoc_files: []
|
|
131
131
|
files:
|
132
132
|
- ".gitignore"
|
133
133
|
- Gemfile
|
134
|
+
- LICENSE
|
134
135
|
- README.md
|
135
136
|
- Rakefile
|
136
137
|
- clearbit.gemspec
|
@@ -138,8 +139,12 @@ files:
|
|
138
139
|
- examples/discovery.rb
|
139
140
|
- examples/enrichment.rb
|
140
141
|
- examples/logo.rb
|
142
|
+
- examples/name_domain.rb
|
141
143
|
- examples/person.rb
|
142
144
|
- examples/prospector.rb
|
145
|
+
- examples/reveal.rb
|
146
|
+
- examples/risk.rb
|
147
|
+
- examples/risk_flag.rb
|
143
148
|
- examples/version.rb
|
144
149
|
- examples/watchlist.rb
|
145
150
|
- lib/clearbit.rb
|
@@ -148,11 +153,13 @@ files:
|
|
148
153
|
- lib/clearbit/discovery.rb
|
149
154
|
- lib/clearbit/enrichment.rb
|
150
155
|
- lib/clearbit/enrichment/company.rb
|
156
|
+
- lib/clearbit/enrichment/news.rb
|
151
157
|
- lib/clearbit/enrichment/person.rb
|
152
158
|
- lib/clearbit/enrichment/person_company.rb
|
153
159
|
- lib/clearbit/errors/invalid_webhook_signature.rb
|
154
160
|
- lib/clearbit/logo.rb
|
155
161
|
- lib/clearbit/mash.rb
|
162
|
+
- lib/clearbit/name_domain.rb
|
156
163
|
- lib/clearbit/pending.rb
|
157
164
|
- lib/clearbit/prospector.rb
|
158
165
|
- lib/clearbit/resource.rb
|
@@ -188,7 +195,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
188
195
|
version: '0'
|
189
196
|
requirements: []
|
190
197
|
rubyforge_project:
|
191
|
-
rubygems_version: 2.
|
198
|
+
rubygems_version: 2.5.1
|
192
199
|
signing_key:
|
193
200
|
specification_version: 4
|
194
201
|
summary: API client for clearbit.com
|
@@ -200,4 +207,3 @@ test_files:
|
|
200
207
|
- spec/lib/clearbit/webhook_spec.rb
|
201
208
|
- spec/spec_helper.rb
|
202
209
|
- spec/support/helpers.rb
|
203
|
-
has_rdoc:
|