linkedindata 0.0.16 → 0.0.17
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/linkedindata.rb +32 -1
- metadata +6 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a5c91c293adffc48f543a68f568efbb3da7995ea
|
4
|
+
data.tar.gz: 61d5376780067945e8666e9aceb2485a58b4391b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 03651bdc5fc45d1c4ca3d15818029f4f8a5b7e743996b9d58955d24354544fbb1f49e459d2b1ad22af3f117a3342bf8b792ae39eca9f84a9f77e35b67cdff303
|
7
|
+
data.tar.gz: a1fb3827faa3f640769cc87d1a84a8c9857e15f4c35151d3b6776ce557ed921e4bbae6a588791452e2b29f951d8525fd16709aa899dc4072bdf01a2a5c2ccdf6
|
data/lib/linkedindata.rb
CHANGED
@@ -101,6 +101,36 @@ class LinkedinData
|
|
101
101
|
return datarr
|
102
102
|
end
|
103
103
|
|
104
|
+
# Add a score to each profile based on the # of times it appears in "people also viewed"
|
105
|
+
def relScore(data)
|
106
|
+
|
107
|
+
# Make list of profiles
|
108
|
+
profiles = Hash.new
|
109
|
+
data.each do |d|
|
110
|
+
profiles[d["profile_url"]] = 0
|
111
|
+
end
|
112
|
+
|
113
|
+
# Get degree for each profile
|
114
|
+
data.each do |i|
|
115
|
+
if i["related_people"]
|
116
|
+
i["related_people"].each do |p|
|
117
|
+
if profiles[p["url"]]
|
118
|
+
# Calculate degree- (2/d*2) except when degree is 0
|
119
|
+
degree_divide = i["degree"] == 0 ? 1 : i["degree"]*2
|
120
|
+
profiles[p["url"]] += (2.0/degree_divide)
|
121
|
+
end
|
122
|
+
end
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
# Merge scores back into dataset
|
127
|
+
data.each do |m|
|
128
|
+
m.merge!(:score => profiles[m["profile_url"]])
|
129
|
+
end
|
130
|
+
|
131
|
+
return data
|
132
|
+
end
|
133
|
+
|
104
134
|
# Gets all data and returns in JSON
|
105
135
|
def getData
|
106
136
|
search
|
@@ -122,7 +152,8 @@ class LinkedinData
|
|
122
152
|
end
|
123
153
|
end
|
124
154
|
|
125
|
-
formatted_json = JSON.pretty_generate(showAllKeys(@output))
|
155
|
+
formatted_json = JSON.pretty_generate(relScore(showAllKeys(@output)))
|
126
156
|
return formatted_json
|
127
157
|
end
|
128
158
|
end
|
159
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: linkedindata
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- M. C. McGrath
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-24 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Scrapes all LinkedIn profiles including terms you specify.
|
14
14
|
email: shidash@shidash.com
|
@@ -16,9 +16,9 @@ executables: []
|
|
16
16
|
extensions: []
|
17
17
|
extra_rdoc_files: []
|
18
18
|
files:
|
19
|
+
- lib/getrelated.rb
|
19
20
|
- lib/linkedindata.rb
|
20
21
|
- lib/parseprofile.rb
|
21
|
-
- lib/getrelated.rb
|
22
22
|
homepage: https://github.com/transparencytoolkit/linkedindata
|
23
23
|
licenses:
|
24
24
|
- GPL
|
@@ -29,19 +29,18 @@ require_paths:
|
|
29
29
|
- lib
|
30
30
|
required_ruby_version: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
|
-
- -
|
32
|
+
- - ">="
|
33
33
|
- !ruby/object:Gem::Version
|
34
34
|
version: '0'
|
35
35
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
|
-
- -
|
37
|
+
- - ">="
|
38
38
|
- !ruby/object:Gem::Version
|
39
39
|
version: '0'
|
40
40
|
requirements: []
|
41
41
|
rubyforge_project:
|
42
|
-
rubygems_version: 2.
|
42
|
+
rubygems_version: 2.4.6
|
43
43
|
signing_key:
|
44
44
|
specification_version: 4
|
45
45
|
summary: Get all LinkedIn profiles including terms you specify
|
46
46
|
test_files: []
|
47
|
-
has_rdoc:
|