Skip to content

Instantly share code, notes, and snippets.

@lukewduncan
Created June 11, 2017 02:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukewduncan/7ab3143952209b1c8ff0941d78170338 to your computer and use it in GitHub Desktop.
Save lukewduncan/7ab3143952209b1c8ff0941d78170338 to your computer and use it in GitHub Desktop.
Method to scan through PDF looking for keywords
def add_keywords_to_profile(user)
io = open(user.resume_pdf.to_s)
reader = PDF::Reader.new(io)
reader.pages.each do |page|
string = page.text
KeywordHelper.keywords.each do |word|
if string.downcase.include?(word.downcase)
user.keywords.push(word)
user.save
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment