linkedindata 0.0.15 → 0.0.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/linkedindata.rb +25 -1
- data/lib/parseprofile.rb +1 -0
- 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: 71a61411dabf9133034b9e13bff8ee97ed718b18
|
4
|
+
data.tar.gz: d00c6243c9fdc2903811b06942579f3a37032c5d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 342759909ac1d68d7b82a372be35517877c8f26ddd7cbeab78cf75af2213bed05734d35bc5ca32354e838ee645882d8f901469d8ddc98648c04d42bababacbfc
|
7
|
+
data.tar.gz: 9e58c3534f8ce88a36b719517a82a9dfc9f7011f6a6235fa740b13036030cef1f07d6091dd2aadddf28ea557483c6da21f7e962a793fd8ad0498f268041a5a33
|
data/lib/linkedindata.rb
CHANGED
@@ -6,6 +6,7 @@ require 'open-uri'
|
|
6
6
|
load 'parseprofile.rb'
|
7
7
|
require 'pry'
|
8
8
|
require 'urlarchiver'
|
9
|
+
require 'set'
|
9
10
|
|
10
11
|
class LinkedinData
|
11
12
|
def initialize(input, todegree)
|
@@ -77,6 +78,29 @@ class LinkedinData
|
|
77
78
|
end
|
78
79
|
end
|
79
80
|
|
81
|
+
# Make sure all keys that occur occur in each item (even if nil)
|
82
|
+
def showAllKeys(data)
|
83
|
+
# Get all keys
|
84
|
+
fields = Set.new
|
85
|
+
data.map { |o| fields.merge(o.keys) }
|
86
|
+
|
87
|
+
# Make sure all items have all keys
|
88
|
+
datarr = Array.new
|
89
|
+
data.each do |d|
|
90
|
+
temphash = Hash.new
|
91
|
+
fields.each do |f|
|
92
|
+
if !d[f]
|
93
|
+
temphash[f] = nil
|
94
|
+
else
|
95
|
+
temphash[f] = d[f]
|
96
|
+
end
|
97
|
+
end
|
98
|
+
datarr.push(temphash)
|
99
|
+
end
|
100
|
+
|
101
|
+
return datarr
|
102
|
+
end
|
103
|
+
|
80
104
|
# Gets all data and returns in JSON
|
81
105
|
def getData
|
82
106
|
search
|
@@ -98,7 +122,7 @@ class LinkedinData
|
|
98
122
|
end
|
99
123
|
end
|
100
124
|
|
101
|
-
formatted_json = JSON.pretty_generate(@output)
|
125
|
+
formatted_json = JSON.pretty_generate(showAllKeys(@output))
|
102
126
|
return formatted_json
|
103
127
|
end
|
104
128
|
end
|
data/lib/parseprofile.rb
CHANGED
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.16
|
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-
|
11
|
+
date: 2015-02-23 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
|