Class: Socialoud::Services::Linkedin
- Inherits:
-
Base
- Object
- Base
- Socialoud::Services::Linkedin
show all
- Defined in:
- lib/socialoud/services/linkedin.rb
Overview
LinkedIn service class doesn’t use official API calls to avoid superfluous authentication
Instance Attribute Summary
Attributes inherited from Base
#aggregator, #data
Instance Method Summary
collapse
Methods inherited from Base
#initialize, #method_missing, #set
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class Socialoud::Services::Base
Instance Method Details
#current ⇒ Object
34
35
36
|
# File 'lib/socialoud/services/linkedin.rb', line 34
def current
clean_str!(@page.css('.summary-current ul.current li').inner_html.strip.gsub(/<\/?[^>]*>/, ""))
end
|
#family_name ⇒ Object
26
27
28
|
# File 'lib/socialoud/services/linkedin.rb', line 26
def family_name
clean_str!(@page.css('#name .family-name').inner_text)
end
|
#first_name ⇒ Object
22
23
24
|
# File 'lib/socialoud/services/linkedin.rb', line 22
def first_name
clean_str!(@page.css('#name .given-name').inner_text)
end
|
#full_name ⇒ Object
18
19
20
|
# File 'lib/socialoud/services/linkedin.rb', line 18
def full_name
clean_str!(@page.css('#name .full-name').inner_text)
end
|
#headline ⇒ Object
30
31
32
|
# File 'lib/socialoud/services/linkedin.rb', line 30
def headline
clean_str!(@page.css('.headline-title.title').inner_text)
end
|
#profile_url ⇒ Object
14
15
16
|
# File 'lib/socialoud/services/linkedin.rb', line 14
def profile_url
@data['url']
end
|
#setup! ⇒ Object
10
11
12
|
# File 'lib/socialoud/services/linkedin.rb', line 10
def setup!
@page = Nokogiri::HTML.parse(HTTParty.get(@data['url']).response.body)
end
|
#skills ⇒ Object
Returns an Array of skills
39
40
41
|
# File 'lib/socialoud/services/linkedin.rb', line 39
def skills
@page.css('ol#skills-list li a').collect {|a| a.inner_text.gsub(/\n/,'').strip }
end
|
#summary ⇒ Object
43
44
45
|
# File 'lib/socialoud/services/linkedin.rb', line 43
def summary
clean_str!(@page.css('p.description.summary').inner_html)
end
|