linkedin-scraper 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d72a6f4f56878e6396f87b2114ee75e73cb71fc4
4
- data.tar.gz: 7ec26c6b44a2cec0551d544ecc72152683eb439a
3
+ metadata.gz: 0f53307f710bf6fc39e07f3c05fbb61eb30ca11e
4
+ data.tar.gz: 937d7021cadbe9dd423b724ede99ebe291a426d4
5
5
  SHA512:
6
- metadata.gz: f69f100f22938a93703177a2495ef439cdb7120c89d2d23ba231849a37a65a9b20173456d68421280faf572798b88e5271f042cb6a8fccba742bd5c2e48299c1
7
- data.tar.gz: e2509eed12a03b23be0860b057c7031c9e467c26e8d2fe2048d7aefa381228ae3ef515fbc0708945a54c1f7e3912b24c0ebfeb3540cd6837350ad378971ea139
6
+ metadata.gz: 2ddb012b496ca60f205f1e3e28c470eedcbd79f6b911e8057a5949bb2058ae3fbd2e6be40f73939041d30c66782a91346633129ac7b0b55afc2e1d8811ed36a0
7
+ data.tar.gz: 499dc5a08c1097e703b885ab85476bb420d9386523eb66ee78e14c34bcc743bea399425655672413107e082a72c40f616e1b35eaa7d422514a5c290f9b6048b7
data/.travis.yml CHANGED
@@ -4,3 +4,4 @@ rvm:
4
4
  - 1.9.3
5
5
  - 1.9.2
6
6
  - jruby-19mode
7
+ - 2.1.1
@@ -179,10 +179,10 @@ module Linkedin
179
179
  result = {:linkedin_company_url => "http://www.linkedin.com#{link}"}
180
180
  page = http_client.get(result[:linkedin_company_url])
181
181
 
182
- result[:url] = page.at('.basic-info/div/dl/dd/a').text if page.at('.basic-info/div/dl/dd/a')
183
- node_2 = page.at('.basic-info/.content.inner-mod')
182
+ result[:url] = page.at('.basic-info-about/ul/li/p/a').text if page.at('.basic-info-about/ul/li/p/a')
183
+ node_2 = page.at('.basic-info-about/ul')
184
184
  if node_2
185
- node_2.search('dd').zip(node_2.search('dt')).each do |value,title|
185
+ node_2.search('p').zip(node_2.search('h4')).each do |value,title|
186
186
  result[title.text.gsub(' ','_').downcase.to_sym] = value.text.strip
187
187
  end
188
188
  end
@@ -1,5 +1,5 @@
1
1
  module Linkedin
2
2
  module Scraper
3
- VERSION = '0.1.1'
3
+ VERSION = '0.1.2'
4
4
  end
5
5
  end
@@ -3,154 +3,150 @@ require 'linkedin-scraper'
3
3
 
4
4
  describe Linkedin::Profile do
5
5
 
6
-
7
- before(:all) do
8
- @page = Nokogiri::HTML(File.open('spec/fixtures/jgrevich.html', 'r') { |f| f.read })
9
- @profile = Linkedin::Profile.new('http://www.linkedin.com/in/jgrevich')
10
- end
6
+ let(:profile) { Linkedin::Profile.new('http://www.linkedin.com/in/jgrevich') }
11
7
 
12
8
  describe '.get_profile' do
13
9
  it 'Create an instance of Linkedin::Profile class' do
14
- expect(@profile).to be_instance_of Linkedin::Profile
10
+ expect(profile).to be_instance_of Linkedin::Profile
15
11
  end
16
12
  end
17
13
 
18
14
  describe '#first_name' do
19
15
  it 'returns the first name of the profile' do
20
- expect(@profile.first_name).to eq 'Justin'
16
+ expect(profile.first_name).to eq 'Justin'
21
17
  end
22
18
  end
23
19
 
24
20
  describe '#last_name' do
25
21
  it 'returns the last name of the profile' do
26
- expect(@profile.last_name).to eq 'Grevich'
22
+ expect(profile.last_name).to eq 'Grevich'
27
23
  end
28
24
  end
29
25
 
30
26
  describe '#title' do
31
27
  it 'returns the title of the profile' do
32
- expect(@profile.title).to eq 'Presidential Innovation Fellow'
28
+ expect(profile.title).to eq 'Presidential Innovation Fellow'
33
29
  end
34
30
  end
35
31
 
36
32
  describe '#location' do
37
33
  it 'returns the location of the profile' do
38
- expect(@profile.location).to eq 'Washington'
34
+ expect(profile.location).to eq 'Seattle'
39
35
  end
40
36
  end
41
37
 
42
38
  describe '#country' do
43
39
  it 'returns the country of the profile' do
44
- expect(@profile.country).to eq 'District Of Columbia'
40
+ expect(profile.country).to eq 'Washington'
45
41
  end
46
42
  end
47
43
 
48
44
  describe '#industry' do
49
45
  it 'returns the industry of the profile' do
50
- expect(@profile.industry).to eq 'Information Technology and Services'
46
+ expect(profile.industry).to eq 'Information Technology and Services'
51
47
  end
52
48
  end
53
49
 
54
50
  describe '#summary' do
55
51
  it 'returns the summary of the profile' do
56
- expect(@profile.summary).to match(/Justin Grevich is a Presidential Innovation Fellow working/)
52
+ expect(profile.summary).to match(/Justin Grevich is a Presidential Innovation Fellow/)
57
53
  end
58
54
  end
59
55
 
60
56
  describe '#picture' do
61
57
  it 'returns the picture url of the profile' do
62
- expect(@profile.picture).to eq 'http://m.c.lnkd.licdn.com/mpr/pub/image-1OSOQPrarAEIMksx5uUyhfRUO9zb6R4JjbULhhrDOMFS6dtV1OSLWbcaOK9b92S3rlE9/justin-grevich.jpg'
58
+ expect(profile.picture).to eq 'http://m.c.lnkd.licdn.com/mpr/pub/image-1OSOQPrarAEIMksx5uUyhfRUO9zb6R4JjbULhhrDOMFS6dtV1OSLWbcaOK9b92S3rlE9/justin-grevich.jpg'
63
59
  end
64
60
  end
65
61
 
66
62
  describe '#skills' do
67
63
  it 'returns the array of skills of the profile' do
68
64
  skills = ['Ruby', 'Ruby on Rails', 'Web Development', 'Web Applications', 'CSS3', 'HTML 5', 'Shell Scripting', 'Python', 'Chef', 'Git', 'Subversion', 'JavaScript', 'Rspec', 'jQuery', 'Capistrano', 'Sinatra', 'CoffeeScript', 'Haml', 'Standards Compliance', 'MySQL', 'PostgreSQL', 'Solr', 'Sphinx', 'Heroku', 'Amazon Web Services (AWS)', 'Information Security', 'Vulnerability Assessment', 'SAN', 'ZFS', 'Backup Solutions', 'SaaS', 'System Administration', 'Project Management', 'Linux', 'Troubleshooting', 'Network Security', 'OS X', 'Bash', 'Cloud Computing', 'Web Design', 'MongoDB', 'Z-Wave', 'Home Automation']
69
- expect(@profile.skills).to include(*skills)
65
+ expect(profile.skills).to include(*skills)
70
66
  end
71
67
  end
72
68
 
73
69
  describe '#past_companies' do
74
70
  it 'returns an array of hashes of past companies with its details' do
75
- @profile.past_companies
71
+ profile.past_companies
76
72
  end
77
73
  end
78
74
 
79
75
  describe '#current_companies' do
80
76
  it 'returns an array of hashes of current companies with its details' do
81
- @profile.current_companies
77
+ profile.current_companies
82
78
  end
83
79
  end
84
80
 
85
81
  describe '#education' do
86
82
  it 'returns the array of hashes of education with details' do
87
- @profile.education
83
+ profile.education
88
84
  end
89
85
  end
90
86
 
91
87
  describe '#websites' do
92
88
  it 'returns the array of websites' do
93
- @profile.websites
89
+ profile.websites
94
90
  end
95
91
  end
96
92
 
97
93
  describe '#groups' do
98
94
  it 'returns the array of hashes of groups with details' do
99
- @profile.groups
95
+ profile.groups
100
96
  end
101
97
  end
102
98
 
103
99
  describe '#name' do
104
100
  it 'returns the first and last name of the profile' do
105
- expect(@profile.name).to eq 'Justin Grevich'
101
+ expect(profile.name).to eq 'Justin Grevich'
106
102
  end
107
103
  end
108
104
 
109
105
  describe '#organizations' do
110
106
  it 'returns an array of organization hashes for the profile' do
111
- expect(@profile.organizations.class).to eq Array
112
- expect(@profile.organizations.first[:name]).to eq 'San Diego Ruby'
107
+ expect(profile.organizations.class).to eq Array
108
+ expect(profile.organizations.first[:name]).to eq 'San Diego Ruby'
113
109
  end
114
110
  end
115
111
 
116
112
  describe '#languages' do
117
113
  it 'returns an array of languages hashes' do
118
- expect(@profile.languages.class).to eq Array
114
+ expect(profile.languages.class).to eq Array
119
115
  end
120
116
 
121
117
  context 'with language data' do
122
118
  it 'returns an array with one language hash' do
123
- expect(@profile.languages.class).to eq Array
119
+ expect(profile.languages.class).to eq Array
124
120
  end
125
121
 
126
122
  describe 'language hash' do
127
123
  it 'contains the key and value for language name' do
128
- expect(@profile.languages.first[:language]).to eq 'English'
124
+ expect(profile.languages.first[:language]).to eq 'English'
129
125
  end
130
126
 
131
127
  it 'contains the key and value for language proficiency' do
132
- expect(@profile.languages.first[:proficiency]).to eq '(Native or bilingual proficiency)'
128
+ expect(profile.languages.first[:proficiency]).to eq '(Native or bilingual proficiency)'
133
129
  end
134
130
  end
135
131
  end # context 'with language data' do
136
132
 
137
133
  end # describe '.languages' do
138
-
134
+ #WIP
139
135
  describe '#recommended_visitors' do
140
136
  it 'returns the array of hashes of recommended visitors' do
141
- @profile.recommended_visitors
137
+ profile.recommended_visitors
142
138
  end
143
139
  end
144
140
 
145
141
  describe '#certifications' do
146
142
  it 'returns the array of hashes of certifications' do
147
- @profile.certifications
143
+ profile.certifications
148
144
  end
149
145
  end
150
146
 
151
147
  describe '#to_json' do
152
148
  it 'returns the json format of the profile' do
153
- @profile.to_json
149
+ profile.to_json
154
150
  end
155
151
  end
156
152
 
data/spec/spec_helper.rb CHANGED
@@ -6,7 +6,6 @@ $: << File.join(File.dirname(__FILE__), '../lib')
6
6
  #
7
7
  # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
8
8
  RSpec.configure do |config|
9
- config.treat_symbols_as_metadata_keys_with_true_values = true
10
9
  config.run_all_when_everything_filtered = true
11
10
  config.filter_run :focus
12
11
 
metadata CHANGED
@@ -1,55 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: linkedin-scraper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
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-03-25 00:00:00.000000000 Z
11
+ date: 2014-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mechanize
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rspec
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  description: 'Scrapes the linkedin profile when a url is given '
@@ -59,9 +59,9 @@ executables:
59
59
  extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
- - .gitignore
63
- - .rubocop.yml
64
- - .travis.yml
62
+ - ".gitignore"
63
+ - ".rubocop.yml"
64
+ - ".travis.yml"
65
65
  - Gemfile
66
66
  - LICENSE
67
67
  - README.md
@@ -83,17 +83,17 @@ require_paths:
83
83
  - lib
84
84
  required_ruby_version: !ruby/object:Gem::Requirement
85
85
  requirements:
86
- - - '>='
86
+ - - ">="
87
87
  - !ruby/object:Gem::Version
88
88
  version: '0'
89
89
  required_rubygems_version: !ruby/object:Gem::Requirement
90
90
  requirements:
91
- - - '>='
91
+ - - ">="
92
92
  - !ruby/object:Gem::Version
93
93
  version: '0'
94
94
  requirements: []
95
95
  rubyforge_project:
96
- rubygems_version: 2.1.11
96
+ rubygems_version: 2.2.2
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: