clearbit-leadscore 0.0.3 → 0.0.4
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 +2 -2
- data/lib/clearbit/lead_score.rb +21 -8
- data/lib/clearbit/lead_score/score.rb +2 -2
- data/lib/clearbit/lead_score/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec42dc2ff6cfa06f91c2e9021115abeb29c4f7a8
|
4
|
+
data.tar.gz: eac4f3d36dd26939c467214a8114f23041e5a44c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 24323de117a402e9b9efaa5e9a846a457ff96974d415938f8a397a95d87b0669ec7638c80027f8e093892581555eff52929e896c40dc1655cf67c365779a8dae
|
7
|
+
data.tar.gz: c5639f214474539d5c08dffb8aacf2249174d020b09be82cda4e31988d6fddab78612ff97fe7747303dd96f7dcfa7c2ff2e924c70420bdd61c8993c22c941143
|
data/README.md
CHANGED
@@ -26,12 +26,12 @@ Then install the gem, `clearbit-leadscore`. A CLI is provided for simple email l
|
|
26
26
|
|
27
27
|
There's also a Ruby API.
|
28
28
|
|
29
|
-
Clearbit::LeadScore.
|
29
|
+
Clearbit::LeadScore.key = ENV['CLEARBIT_KEY']
|
30
30
|
|
31
31
|
result = Clearbit::LeadScore.lookup(email)
|
32
32
|
|
33
33
|
if result
|
34
|
-
puts "Name: #{result.name}"
|
34
|
+
puts "Name: #{result.person.try(:name)}"
|
35
35
|
puts "Company name: #{result.company.try(:name)}"
|
36
36
|
|
37
37
|
if result.score > 0.5
|
data/lib/clearbit/lead_score.rb
CHANGED
@@ -13,15 +13,23 @@ module Clearbit
|
|
13
13
|
Clearbit.key = value
|
14
14
|
end
|
15
15
|
|
16
|
-
def baller?(email,
|
17
|
-
|
16
|
+
def baller?(email, threshold = 0.7)
|
17
|
+
score(email) > threshold
|
18
|
+
end
|
18
19
|
|
19
|
-
|
20
|
+
def score(email)
|
21
|
+
result = lookup(email)
|
22
|
+
result && result.score || 0
|
20
23
|
end
|
21
24
|
|
22
25
|
def lookup(email)
|
23
26
|
if email =~ /.+@.+/
|
24
|
-
person
|
27
|
+
person = Streaming::Person[email: email]
|
28
|
+
|
29
|
+
if person && person.company && person.company != {}
|
30
|
+
company = person.company
|
31
|
+
end
|
32
|
+
|
25
33
|
suffix, domain = email.split('@', 2)
|
26
34
|
|
27
35
|
else
|
@@ -29,7 +37,7 @@ module Clearbit
|
|
29
37
|
end
|
30
38
|
|
31
39
|
unless EmailProviders::DOMAINS.include?(domain)
|
32
|
-
company
|
40
|
+
company ||= Streaming::Company[domain: domain]
|
33
41
|
end
|
34
42
|
|
35
43
|
return unless person || company
|
@@ -39,9 +47,14 @@ module Clearbit
|
|
39
47
|
company: company
|
40
48
|
)
|
41
49
|
|
42
|
-
|
43
|
-
|
44
|
-
|
50
|
+
begin
|
51
|
+
result.merge!(
|
52
|
+
score: Score.calculate(result)
|
53
|
+
)
|
54
|
+
rescue => e
|
55
|
+
p result
|
56
|
+
raise e
|
57
|
+
end
|
45
58
|
|
46
59
|
result
|
47
60
|
end
|
@@ -4,14 +4,14 @@ module Clearbit
|
|
4
4
|
attr_accessor :defaults
|
5
5
|
|
6
6
|
self.defaults = Mash.new({
|
7
|
-
twitter_followers_weight: 0.
|
7
|
+
twitter_followers_weight: 0.09,
|
8
8
|
angellist_followers_weight: 0.05,
|
9
9
|
klout_score_weight: 0.05,
|
10
10
|
company_twitter_followers_weight: 0.05,
|
11
11
|
company_alexa_rank_weight: 0.000005,
|
12
12
|
company_google_rank_weight: 0.05,
|
13
13
|
company_employees_weight: 0.5,
|
14
|
-
company_raised_weight: 0.
|
14
|
+
company_raised_weight: 0.00005,
|
15
15
|
company_score: 10,
|
16
16
|
total_score: 1415
|
17
17
|
})
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: clearbit-leadscore
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
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-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|