linkedin-scraper 0.1.5 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -1
- data/README.md +17 -7
- data/bin/linkedin-scraper +1 -1
- data/lib/linkedin_scraper/profile.rb +243 -0
- data/lib/{linkedin-scraper → linkedin_scraper}/version.rb +1 -1
- data/lib/linkedin_scraper.rb +5 -0
- data/linkedin-scraper.gemspec +7 -6
- data/spec/fixtures/jeffweiner08.html +308 -0
- data/spec/linkedin_scraper/.DS_Store +0 -0
- data/spec/linkedin_scraper/profile_spec.rb +104 -0
- metadata +27 -24
- data/lib/linkedin-scraper/profile.rb +0 -225
- data/lib/linkedin-scraper.rb +0 -5
- data/spec/fixtures/jgrevich.html +0 -9300
- data/spec/linkedin-scraper/profile_spec.rb +0 -154
@@ -1,154 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'linkedin-scraper'
|
3
|
-
|
4
|
-
describe Linkedin::Profile do
|
5
|
-
|
6
|
-
let(:profile) { Linkedin::Profile.new('http://www.linkedin.com/in/jgrevich') }
|
7
|
-
|
8
|
-
describe '.get_profile' do
|
9
|
-
it 'Create an instance of Linkedin::Profile class' do
|
10
|
-
expect(profile).to be_instance_of Linkedin::Profile
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
describe '#first_name' do
|
15
|
-
it 'returns the first name of the profile' do
|
16
|
-
expect(profile.first_name).to eq 'Justin'
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
describe '#last_name' do
|
21
|
-
it 'returns the last name of the profile' do
|
22
|
-
expect(profile.last_name).to eq 'Grevich'
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
describe '#title' do
|
27
|
-
it 'returns the title of the profile' do
|
28
|
-
expect(profile.title).to eq 'Presidential Innovation Fellow'
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
describe '#location' do
|
33
|
-
it 'returns the location of the profile' do
|
34
|
-
expect(profile.location).to eq 'Seattle'
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
describe '#country' do
|
39
|
-
it 'returns the country of the profile' do
|
40
|
-
expect(profile.country).to eq 'Washington'
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
describe '#industry' do
|
45
|
-
it 'returns the industry of the profile' do
|
46
|
-
expect(profile.industry).to eq 'Information Technology and Services'
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
describe '#summary' do
|
51
|
-
it 'returns the summary of the profile' do
|
52
|
-
expect(profile.summary).to match(/Justin Grevich is a Presidential Innovation Fellow/)
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
describe '#picture' do
|
57
|
-
it 'returns the picture url of the profile' do
|
58
|
-
profile.picture
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
|
-
describe '#skills' do
|
63
|
-
pending 'returns the array of skills of the profile' do
|
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']
|
65
|
-
expect(profile.skills).to include(*skills)
|
66
|
-
end
|
67
|
-
end
|
68
|
-
|
69
|
-
describe '#past_companies' do
|
70
|
-
it 'returns an array of hashes of past companies with its details' do
|
71
|
-
profile.past_companies
|
72
|
-
end
|
73
|
-
end
|
74
|
-
|
75
|
-
describe '#current_companies' do
|
76
|
-
it 'returns an array of hashes of current companies with its details' do
|
77
|
-
profile.current_companies
|
78
|
-
end
|
79
|
-
end
|
80
|
-
|
81
|
-
describe '#education' do
|
82
|
-
it 'returns the array of hashes of education with details' do
|
83
|
-
profile.education
|
84
|
-
end
|
85
|
-
end
|
86
|
-
|
87
|
-
describe '#websites' do
|
88
|
-
it 'returns the array of websites' do
|
89
|
-
profile.websites
|
90
|
-
end
|
91
|
-
end
|
92
|
-
|
93
|
-
describe '#groups' do
|
94
|
-
it 'returns the array of hashes of groups with details' do
|
95
|
-
profile.groups
|
96
|
-
end
|
97
|
-
end
|
98
|
-
|
99
|
-
describe '#name' do
|
100
|
-
it 'returns the first and last name of the profile' do
|
101
|
-
expect(profile.name).to eq 'Justin Grevich'
|
102
|
-
end
|
103
|
-
end
|
104
|
-
|
105
|
-
describe '#organizations' do
|
106
|
-
it 'returns an array of organization hashes for the profile' do
|
107
|
-
expect(profile.organizations.class).to eq Array
|
108
|
-
expect(profile.organizations.first[:name]).to eq 'San Diego Ruby'
|
109
|
-
end
|
110
|
-
end
|
111
|
-
|
112
|
-
describe '#languages' do
|
113
|
-
it 'returns an array of languages hashes' do
|
114
|
-
expect(profile.languages.class).to eq Array
|
115
|
-
end
|
116
|
-
|
117
|
-
context 'with language data' do
|
118
|
-
it 'returns an array with one language hash' do
|
119
|
-
expect(profile.languages.class).to eq Array
|
120
|
-
end
|
121
|
-
|
122
|
-
describe 'language hash' do
|
123
|
-
it 'contains the key and value for language name' do
|
124
|
-
expect(profile.languages.first[:language]).to eq 'English'
|
125
|
-
end
|
126
|
-
|
127
|
-
it 'contains the key and value for language proficiency' do
|
128
|
-
expect(profile.languages.first[:proficiency]).to eq 'Native or bilingual proficiency'
|
129
|
-
end
|
130
|
-
end
|
131
|
-
end # context 'with language data' do
|
132
|
-
|
133
|
-
end # describe '.languages' do
|
134
|
-
|
135
|
-
# WIP
|
136
|
-
describe '#recommended_visitors' do
|
137
|
-
it 'returns the array of hashes of recommended visitors' do
|
138
|
-
profile.recommended_visitors
|
139
|
-
end
|
140
|
-
end
|
141
|
-
|
142
|
-
describe '#certifications' do
|
143
|
-
it 'returns the array of hashes of certifications' do
|
144
|
-
profile.certifications
|
145
|
-
end
|
146
|
-
end
|
147
|
-
|
148
|
-
describe '#to_json' do
|
149
|
-
it 'returns the json format of the profile' do
|
150
|
-
profile.to_json
|
151
|
-
end
|
152
|
-
end
|
153
|
-
|
154
|
-
end
|