Created
July 3, 2009 07:38
-
-
Save cduruk/139989 to your computer and use it in GitHub Desktop.
This file contains 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
# You actually need to be logged in for this to work. Even then, no guarantees | |
require 'rubygems' | |
require 'open-uri' | |
require 'nokogiri' | |
require 'net/http' | |
#target = 'http://www.linkedin.com/in/'+ARGV[0] | |
result = Nokogiri::HTML(open(ARGV[0])) | |
user_key = nil | |
result.xpath('//li[@id="add-to-network"]/a').each do |link| | |
user_key = link.to_s.slice(/\d+/) | |
end | |
location = '/profile?viewProfilePDF=&key='+user_key.to_s+'&trk=pdf_pro_my' | |
puts location | |
Net::HTTP.start("www.linkedin.com") { |http| | |
resp = http.get(location) | |
open(user_key+"resume.pdf", "wb") { |file| | |
file.write(resp.body) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment