linkedin-scraper 0.1.3 → 0.1.5
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/.travis.yml +1 -1
- data/lib/linkedin-scraper/profile.rb +27 -9
- data/lib/linkedin-scraper/version.rb +1 -1
- data/spec/linkedin-scraper/profile_spec.rb +4 -3
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc9d61aa2d048763671b81e1c5389761897c9a95
|
4
|
+
data.tar.gz: a092ceaaf5ab5e5a622bf400539f0d77697f4cb3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 732f37109c5194922ed01d7a2a0db4d69696a8a87ad0ffb0b181eff550cac8ebcbdfb62b4a4c7de30066d4610b1ee488872ce9da992dee633bb0a30ca887ccd4
|
7
|
+
data.tar.gz: 7b8d05df2f6533fb4428e1852390f6fb16065828a27367f0a3fe0a476a7596eb59d31d14b819190e4da71eb3f88b0767e336c6d6ab2fb78221886e035e51d225
|
data/.travis.yml
CHANGED
@@ -5,7 +5,27 @@ module Linkedin
|
|
5
5
|
|
6
6
|
USER_AGENTS = ['Windows IE 6', 'Windows IE 7', 'Windows Mozilla', 'Mac Safari', 'Mac FireFox', 'Mac Mozilla', 'Linux Mozilla', 'Linux Firefox', 'Linux Konqueror']
|
7
7
|
|
8
|
-
ATTRIBUTES = %w(
|
8
|
+
ATTRIBUTES = %w(
|
9
|
+
name
|
10
|
+
first_name
|
11
|
+
last_name
|
12
|
+
title
|
13
|
+
location
|
14
|
+
country
|
15
|
+
industry
|
16
|
+
summary
|
17
|
+
picture
|
18
|
+
linkedin_url
|
19
|
+
education
|
20
|
+
groups
|
21
|
+
websites
|
22
|
+
languages
|
23
|
+
skills
|
24
|
+
certifications
|
25
|
+
organizations
|
26
|
+
past_companies
|
27
|
+
current_companies
|
28
|
+
recommended_visitors)
|
9
29
|
|
10
30
|
attr_reader :page, :linkedin_url
|
11
31
|
|
@@ -95,9 +115,9 @@ module Linkedin
|
|
95
115
|
end
|
96
116
|
|
97
117
|
def organizations
|
98
|
-
@organizations ||= @page.search('
|
99
|
-
name = item.text.gsub(/\s+|\n/, ' ').strip rescue nil
|
100
|
-
start_date, end_date = item.
|
118
|
+
@organizations ||= @page.search('#background-organizations .section-item').map do |item|
|
119
|
+
name = item.at('.summary').text.gsub(/\s+|\n/, ' ').strip rescue nil
|
120
|
+
start_date, end_date = item.at('.organizations-date').text.gsub(/\s+|\n/, ' ').strip.split(' – ') rescue nil
|
101
121
|
start_date = Date.parse(start_date) rescue nil
|
102
122
|
end_date = Date.parse(end_date) rescue nil
|
103
123
|
{ :name => name, :start_date => start_date, :end_date => end_date }
|
@@ -149,16 +169,14 @@ module Linkedin
|
|
149
169
|
|
150
170
|
company = {}
|
151
171
|
company[:title] = node.at('h4').text.gsub(/\s+|\n/, ' ').strip if node.at('h4')
|
152
|
-
company[:company] = node.at('
|
172
|
+
company[:company] = node.at('h4').next.text.gsub(/\s+|\n/, ' ').strip if node.at('h4').next
|
153
173
|
company[:description] = node.at(".description").text.gsub(/\s+|\n/, ' ').strip if node.at(".description")
|
154
174
|
|
155
|
-
start_date = node.at('.
|
175
|
+
start_date, end_date = node.at('.experience-date-locale').text.strip.split(" – ") rescue nil
|
156
176
|
company[:start_date] = parse_date(start_date) rescue nil
|
157
|
-
|
158
|
-
end_date = node.at('.dtend')['title'] rescue nil
|
159
177
|
company[:end_date] = parse_date(end_date) rescue nil
|
160
178
|
|
161
|
-
company_link = node.at('
|
179
|
+
company_link = node.at('h4').next.at('a')['href'] if node.at('h4').next.at('a')
|
162
180
|
|
163
181
|
result = get_company_details(company_link)
|
164
182
|
companies << company.merge!(result)
|
@@ -54,8 +54,8 @@ describe Linkedin::Profile do
|
|
54
54
|
end
|
55
55
|
|
56
56
|
describe '#picture' do
|
57
|
-
|
58
|
-
|
57
|
+
it 'returns the picture url of the profile' do
|
58
|
+
profile.picture
|
59
59
|
end
|
60
60
|
end
|
61
61
|
|
@@ -103,7 +103,7 @@ describe Linkedin::Profile do
|
|
103
103
|
end
|
104
104
|
|
105
105
|
describe '#organizations' do
|
106
|
-
|
106
|
+
it 'returns an array of organization hashes for the profile' do
|
107
107
|
expect(profile.organizations.class).to eq Array
|
108
108
|
expect(profile.organizations.first[:name]).to eq 'San Diego Ruby'
|
109
109
|
end
|
@@ -131,6 +131,7 @@ describe Linkedin::Profile do
|
|
131
131
|
end # context 'with language data' do
|
132
132
|
|
133
133
|
end # describe '.languages' do
|
134
|
+
|
134
135
|
# WIP
|
135
136
|
describe '#recommended_visitors' do
|
136
137
|
it 'returns the array of hashes of recommended visitors' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: linkedin-scraper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yatish Mehta
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mechanize
|
@@ -93,7 +93,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
93
93
|
version: '0'
|
94
94
|
requirements: []
|
95
95
|
rubyforge_project:
|
96
|
-
rubygems_version: 2.
|
96
|
+
rubygems_version: 2.4.5
|
97
97
|
signing_key:
|
98
98
|
specification_version: 4
|
99
99
|
summary: when a url of public linkedin profile page is given it scrapes the entire
|
@@ -102,4 +102,3 @@ test_files:
|
|
102
102
|
- spec/fixtures/jgrevich.html
|
103
103
|
- spec/linkedin-scraper/profile_spec.rb
|
104
104
|
- spec/spec_helper.rb
|
105
|
-
has_rdoc:
|