Skip to content

Instantly share code, notes, and snippets.

@cduruk
Created July 3, 2009 07:38
Show Gist options
  • Save cduruk/139989 to your computer and use it in GitHub Desktop.
Save cduruk/139989 to your computer and use it in GitHub Desktop.
# 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