Scrape MySpace friend thumbnails


Scrape MySpace friend thumbnails

can anyone tell me how this could be used?
// fetch all img's from a myspace profile's .friendSpace div
// more @ http://tramchase.com/scrape-myspace-youtube-torrents-for-fun-and-profit

agent = WWW::Mechanize.new
agent.get("http://myspace.com/graffitiresearchlab")
links = agent.page.search('.friendSpace img') # found w/ firebug
FileUtils.mkdir_p 'myspace-images' # make the images dir
links.each_with_index { |link, index|
url = link['src']
puts "Saving thumbnail #{url}"
agent.get(url).save_as("myspace-images/top_friend#{index}_#{File.basename url}")

taken from this website.
http://textsnippets.com/posts/show/1347