Class: IndeedPersonalInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/indeed_personal_info.rb

Instance Method Summary collapse

Constructor Details

#initialize(html, url) ⇒ IndeedPersonalInfo

Returns a new instance of IndeedPersonalInfo.



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/indeed_personal_info.rb', line 11

def initialize(html, url)
  @raw_html = html
  @html = Nokogiri::HTML(html)
  @url = url

  @personal_info = {
    name: name,
    url: @url,
    location: location,
    current_title: current_title,
    skills: skills,
    summary: summary,
    additional_info: additional_info,
    last_updated: last_updated,
    degrees: degrees,
    military_service: military_service,
    certifications: certifications,
    rec_people: rec_people,
    links: links,
    awards: awards,
    groups: groups,
    fulltext: @raw_html
  }
end

Instance Method Details

#additional_infoObject

Get additional info



109
110
111
# File 'lib/indeed_personal_info.rb', line 109

def additional_info
  @html.xpath("//div[@id='additionalinfo-section']//p").text
end

#awardsObject

Get list of awards



60
61
62
63
# File 'lib/indeed_personal_info.rb', line 60

def awards
  a = IndeedAwards.new(@html)
  a.get_awards
end

#certificationsObject

Get certification data



42
43
44
45
# File 'lib/indeed_personal_info.rb', line 42

def certifications
  c = IndeedCertifications.new(@html)
  c.get_certifications
end

#current_titleObject

Get overall job title



94
95
96
# File 'lib/indeed_personal_info.rb', line 94

def current_title
  @html.xpath("//h2[@id='headline']").text
end

#degreesObject

Get list of degrees



72
73
74
75
# File 'lib/indeed_personal_info.rb', line 72

def degrees
  d = IndeedDegrees.new(@html)
  d.get_degrees
end

#get_personal_infoObject

Return personal info hash



37
38
39
# File 'lib/indeed_personal_info.rb', line 37

def get_personal_info
  return @personal_info
end

#groupsObject

Get list of groups



66
67
68
69
# File 'lib/indeed_personal_info.rb', line 66

def groups
  g = IndeedGroups.new(@html)
  g.get_groups
end

#last_updatedObject

Get last updated time



114
115
116
# File 'lib/indeed_personal_info.rb', line 114

def last_updated
  @html.xpath("//div[@id='resume_actions_contacted']").text.gsub("Updated: ", "")
end

Get any links they list



54
55
56
57
# File 'lib/indeed_personal_info.rb', line 54

def links
  l = IndeedLinks.new(@html)
  l.get_links
end

#locationObject

Get location



89
90
91
# File 'lib/indeed_personal_info.rb', line 89

def location
  @html.xpath("//p[@id='headline_location']").text
end

#military_serviceObject

Get military service



78
79
80
81
# File 'lib/indeed_personal_info.rb', line 78

def military_service
  m = IndeedMilitaryService.new(@html)
  m.get_military_service
end

#nameObject

Get persons name



84
85
86
# File 'lib/indeed_personal_info.rb', line 84

def name
  @html.xpath("//h1[@itemprop='name']").text
end

#rec_peopleObject

Get list of suggested resumes from side



48
49
50
51
# File 'lib/indeed_personal_info.rb', line 48

def rec_people
  r = IndeedRecPeople.new(@html)
  r.get_rec_people
end

#skillsObject

Get skills section



99
100
101
# File 'lib/indeed_personal_info.rb', line 99

def skills
  @html.xpath("//span[@class='skill-text']").text
end

#summaryObject

Get summary



104
105
106
# File 'lib/indeed_personal_info.rb', line 104

def summary
  @html.xpath("//p[@id='res_summary']").text
end