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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 36e18b156982017e74c482b3e9656c00aca5c93a
4
- data.tar.gz: 7179629d7d60aa6ff707b80b1820e87565134f40
3
+ metadata.gz: fc9d61aa2d048763671b81e1c5389761897c9a95
4
+ data.tar.gz: a092ceaaf5ab5e5a622bf400539f0d77697f4cb3
5
5
  SHA512:
6
- metadata.gz: e6e8871534374809abc5e5c92f13964995ee90976bd7f0f2bdecd1d4f87dc227cbe4788edc2c21b478fd1c237c726a6ce7f198e951755937b0c8536f58687064
7
- data.tar.gz: f765dd85d08aa37b6949e62d278cb428e7267f88f2889f95abc248758b947f8813eca239bbe2a10bd37bfaac9ee072bab5d9c7000eaf8ffd87e614a05e854f4f
6
+ metadata.gz: 732f37109c5194922ed01d7a2a0db4d69696a8a87ad0ffb0b181eff550cac8ebcbdfb62b4a4c7de30066d4610b1ee488872ce9da992dee633bb0a30ca887ccd4
7
+ data.tar.gz: 7b8d05df2f6533fb4428e1852390f6fb16065828a27367f0a3fe0a476a7596eb59d31d14b819190e4da71eb3f88b0767e336c6d6ab2fb78221886e035e51d225
data/.travis.yml CHANGED
@@ -1,7 +1,7 @@
1
1
  language: ruby
2
2
  rvm:
3
+ - 2.2.0
3
4
  - 2.0.0
4
5
  - 1.9.3
5
- - 1.9.2
6
6
  - jruby-19mode
7
7
  - 2.1.1
@@ -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(name first_name last_name title location country industry summary picture linkedin_url education groups websites languages skills certifications organizations past_companies current_companies recommended_visitors)
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('.background-organizations .organization p a').map do |item|
99
- name = item.text.gsub(/\s+|\n/, ' ').strip rescue nil
100
- start_date, end_date = item.search('ul.specifics li').text.gsub(/\s+|\n/, ' ').strip.split(' to ')
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('h5').text.gsub(/\s+|\n/, ' ').strip if node.at('h5')
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('.dtstart')['title'] rescue nil
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('h5/a')['href'] if node.at('h5/a')
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)
@@ -1,5 +1,5 @@
1
1
  module Linkedin
2
2
  module Scraper
3
- VERSION = '0.1.3'
3
+ VERSION = '0.1.5'
4
4
  end
5
5
  end
@@ -54,8 +54,8 @@ describe Linkedin::Profile do
54
54
  end
55
55
 
56
56
  describe '#picture' do
57
- pending 'returns the picture url of the profile' do
58
- expect(profile.picture).to eq 'http://m.c.lnkd.licdn.com/mpr/pub/image-1OSOQPrarAEIMksx5uUyhfRUO9zb6R4JjbULhhrDOMFS6dtV1OSLWbcaOK9b92S3rlE9/justin-grevich.jpg'
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
- pending 'returns an array of organization hashes for the profile' do
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.3
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: 2014-11-04 00:00:00.000000000 Z
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.2.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: