Class: NetworkProfile::XingProfile

Inherits:
DefaultProfile show all
Defined in:
lib/network_profile/extractors/xing_profile.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from DefaultProfile

all_types, auto_extractor_link_types, #data, #image, #initialize, parse

Constructor Details

This class inherits a constructor from NetworkProfile::DefaultProfile

Class Method Details

.handle?(link) ⇒ Boolean

Returns:

  • (Boolean)


5
6
7
# File 'lib/network_profile/extractors/xing_profile.rb', line 5

def self.handle?(link)
  link['xing.com/profile/']
end

Instance Method Details

#extra_dataObject



17
18
19
20
21
22
23
# File 'lib/network_profile/extractors/xing_profile.rb', line 17

def extra_data
  {
    employment_status: doc.at('[data-qa=xing-id-work_experience]')&.text&.split(', ')&.first,
    tags: json_ld&.fetch('makesOffer', [])&.map { |i| i['name'] } || [],
    languages: doc.at('[data-qa=language-skills-section]')&.search('li')&.map { |i| "#{i.at('h3').text} (#{i.at('div').text})" },
  }
end

#textObject



13
14
15
# File 'lib/network_profile/extractors/xing_profile.rb', line 13

def text
  json_ld.dig('jobTitle')
end

#titleObject



9
10
11
# File 'lib/network_profile/extractors/xing_profile.rb', line 9

def title
  doc.at('h1')&.text&.strip
end