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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c2fab0d003e3376ebff21752d59afaa593aaeb87
4
- data.tar.gz: bb8c58beafdec8b4630bb88e9edf73901175a44e
3
+ metadata.gz: 9bfa4e2e52a22c81346477b50bbd5d4152abf27a
4
+ data.tar.gz: 0ddaa5a863838daf609679587149fdc32ee9af40
5
5
  SHA512:
6
- metadata.gz: b8dc286b83eac1dcd4f76fa5b4949aad3fa15f45c4df635055ca85a46b81ef78b01bfc4b4d1f831368cc1e1011689637baf3d2254039e46d387310ade7f223de
7
- data.tar.gz: 56d2b80cfed16e25ee0c78aaaf3dc1762f16ca33f9a871dfaee10731c07a5d11542b72ae3817f44e4935eb2b6fffc16101de757a51d7985697a8c3cfef172218
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.
@@ -0,0 +1,4 @@
1
+ require 'clearbit'
2
+ require 'pp'
3
+
4
+ pp Clearbit::NameDomain.find(name: 'Stripe')
@@ -0,0 +1,11 @@
1
+ require 'clearbit'
2
+ require 'csv'
3
+
4
+ puts 'domain,fuzzy'
5
+
6
+ STDIN.read.each_line do |line|
7
+ result = Clearbit::Reveal.find(ip: line.strip)
8
+ next puts unless result
9
+ puts CSV.generate_line([result.domain, result.fuzzy])
10
+ end
11
+
@@ -0,0 +1,13 @@
1
+ require 'clearbit'
2
+
3
+ # Step 1)
4
+ # Add the JS library + load it
5
+ # https://clearbit.com/docs#risk-api-javascript-library
6
+
7
+ # Step 2)
8
+ result = Clearbit::Risk.calculate(
9
+ email: 'test@example.com',
10
+ ip: '0.0.0.0'
11
+ )
12
+
13
+ p result
@@ -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
@@ -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'
@@ -1,6 +1,7 @@
1
1
  module Clearbit
2
2
  module Enrichment extend self
3
3
  autoload :Company, 'clearbit/enrichment/company'
4
+ autoload :News, 'clearbit/enrichment/news'
4
5
  autoload :Person, 'clearbit/enrichment/person'
5
6
  autoload :PersonCompany, 'clearbit/enrichment/person_company'
6
7
 
@@ -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
+
@@ -4,7 +4,7 @@ module Clearbit
4
4
  path '/v1'
5
5
 
6
6
  def self.calculate(values = {})
7
- self.new get('calculate', values)
7
+ self.new post('calculate', values)
8
8
  end
9
9
 
10
10
  def self.confirmed(values = {})
@@ -1,3 +1,3 @@
1
1
  module Clearbit
2
- VERSION = '0.2.7'
2
+ VERSION = '0.2.8'
3
3
  end
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.7
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: 2016-10-22 00:00:00.000000000 Z
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.2.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: