Created
June 11, 2017 02:29
-
-
Save lukewduncan/7ab3143952209b1c8ff0941d78170338 to your computer and use it in GitHub Desktop.
Method to scan through PDF looking for keywords
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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