clearbit 0.0.7 → 0.0.8
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/README.md +1 -1
- data/examples/email.rb +1 -1
- data/lib/clearbit.rb +1 -0
- data/lib/clearbit/company.rb +12 -0
- data/lib/clearbit/person.rb +12 -0
- data/lib/clearbit/person_company.rb +44 -0
- data/lib/clearbit/streaming.rb +1 -0
- data/lib/clearbit/streaming/person_company.rb +7 -0
- data/lib/clearbit/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 62de0c264e9a31b66e22a1367305f8fa2b64bd1e
|
4
|
+
data.tar.gz: b7ddc44248895bce32d13eeafdcac1a2ed9115f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 522e5e1c1f407333f839b87d7e16a09fe3a3670d453041d497afe5c80b9cbd2c2c5094e81f652d6482bd07dfb96d04142917a02c7b785de7c49c61cfcaef42c0
|
7
|
+
data.tar.gz: 8c1c5b067d886ff523c63524a10c091dac9137f317c9f4d9eff9b4fd4414038dcc1b1a30825ba3514353c71c23282858a361f31b9bff7fc7165ae0ec5ab6c33f
|
data/README.md
CHANGED
@@ -20,7 +20,7 @@ Or install it yourself as:
|
|
20
20
|
|
21
21
|
First authorize requests by setting the API key found on your [account's settings page](https://clearbit.co/profile).
|
22
22
|
|
23
|
-
Clearbit.
|
23
|
+
Clearbit.key = ENV['CLEARBIT_KEY']
|
24
24
|
|
25
25
|
Then you can lookup people by email address:
|
26
26
|
|
data/examples/email.rb
CHANGED
data/lib/clearbit.rb
CHANGED
@@ -17,6 +17,7 @@ module Clearbit
|
|
17
17
|
autoload :Company, 'clearbit/company'
|
18
18
|
autoload :Mash, 'clearbit/mash'
|
19
19
|
autoload :Person, 'clearbit/person'
|
20
|
+
autoload :PersonCompany, 'clearbit/person_company'
|
20
21
|
autoload :Resource, 'clearbit/resource'
|
21
22
|
autoload :Streaming, 'clearbit/streaming'
|
22
23
|
autoload :Watchlist, 'clearbit/watchlist'
|
data/lib/clearbit/company.rb
CHANGED
@@ -11,6 +11,18 @@ module Clearbit
|
|
11
11
|
options = options.dup
|
12
12
|
params = options.delete(:params) || {}
|
13
13
|
|
14
|
+
if webhook_id = options.delete(:webhook_id)
|
15
|
+
params.merge!(webhook_id: webhook_id)
|
16
|
+
end
|
17
|
+
|
18
|
+
if webhook_url = options.delete(:webhook_url)
|
19
|
+
params.merge!(webhook_url: webhook_url)
|
20
|
+
end
|
21
|
+
|
22
|
+
if subscribe = options.delete(:subscribe)
|
23
|
+
params.merge!(subscribe: subscribe)
|
24
|
+
end
|
25
|
+
|
14
26
|
if domain = values[:domain]
|
15
27
|
response = get(uri(:domain, domain), params, options)
|
16
28
|
|
data/lib/clearbit/person.rb
CHANGED
@@ -11,6 +11,18 @@ module Clearbit
|
|
11
11
|
options = options.dup
|
12
12
|
params = options.delete(:params) || {}
|
13
13
|
|
14
|
+
if webhook_id = options.delete(:webhook_id)
|
15
|
+
params.merge!(webhook_id: webhook_id)
|
16
|
+
end
|
17
|
+
|
18
|
+
if webhook_url = options.delete(:webhook_url)
|
19
|
+
params.merge!(webhook_url: webhook_url)
|
20
|
+
end
|
21
|
+
|
22
|
+
if subscribe = options.delete(:subscribe)
|
23
|
+
params.merge!(subscribe: subscribe)
|
24
|
+
end
|
25
|
+
|
14
26
|
if email = values[:email]
|
15
27
|
response = get(uri(:email, email), params, options)
|
16
28
|
|
@@ -0,0 +1,44 @@
|
|
1
|
+
module Clearbit
|
2
|
+
class PersonCompany < Base
|
3
|
+
endpoint 'https://person.clearbit.co'
|
4
|
+
path '/v1/combined'
|
5
|
+
|
6
|
+
def self.find(values, options = {})
|
7
|
+
unless values.is_a?(Hash)
|
8
|
+
values = {:id => values}
|
9
|
+
end
|
10
|
+
|
11
|
+
options = options.dup
|
12
|
+
params = options.delete(:params) || {}
|
13
|
+
|
14
|
+
if webhook_id = options.delete(:webhook_id)
|
15
|
+
params.merge!(webhook_id: webhook_id)
|
16
|
+
end
|
17
|
+
|
18
|
+
if webhook_url = options.delete(:webhook_url)
|
19
|
+
params.merge!(webhook_url: webhook_url)
|
20
|
+
end
|
21
|
+
|
22
|
+
if subscribe = options.delete(:subscribe)
|
23
|
+
params.merge!(subscribe: subscribe)
|
24
|
+
end
|
25
|
+
|
26
|
+
if email = values[:email]
|
27
|
+
response = get(uri(:email, email), params, options)
|
28
|
+
else
|
29
|
+
raise ArgumentError, 'Invalid values'
|
30
|
+
end
|
31
|
+
|
32
|
+
if response.status == 202
|
33
|
+
self.new(pending: true)
|
34
|
+
else
|
35
|
+
self.new(response)
|
36
|
+
end
|
37
|
+
rescue Nestful::ResourceNotFound
|
38
|
+
end
|
39
|
+
|
40
|
+
class << self
|
41
|
+
alias_method :[], :find
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
data/lib/clearbit/streaming.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.0.
|
4
|
+
version: 0.0.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: 2014-
|
11
|
+
date: 2014-10-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -73,10 +73,12 @@ files:
|
|
73
73
|
- lib/clearbit/company.rb
|
74
74
|
- lib/clearbit/mash.rb
|
75
75
|
- lib/clearbit/person.rb
|
76
|
+
- lib/clearbit/person_company.rb
|
76
77
|
- lib/clearbit/resource.rb
|
77
78
|
- lib/clearbit/streaming.rb
|
78
79
|
- lib/clearbit/streaming/company.rb
|
79
80
|
- lib/clearbit/streaming/person.rb
|
81
|
+
- lib/clearbit/streaming/person_company.rb
|
80
82
|
- lib/clearbit/version.rb
|
81
83
|
- lib/clearbit/watchlist.rb
|
82
84
|
homepage: https://github.com/maccman/clearbit-ruby
|