Created
October 2, 2013 10:55
-
-
Save delucas/6791998 to your computer and use it in GitHub Desktop.
Youtube playlist video scrapper, based on @lucasefe gist: https://gist.github.com/lucasefe/6319125
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
# encoding: utf-8 | |
require 'mechanize' | |
require 'csv' | |
START_URL = 'http://www.youtube.com/playlist?list=PLkuS0waF8krjwcRHzSJMq_nA67mCFi24T' | |
STDOUT.sync = true | |
agent = Mechanize.new | |
page = agent.get START_URL | |
page.links.each do |link| | |
if link.text =~ /.*PyConAr.*/i | |
begin | |
conf_name = link.text | |
conf_link = link.click.uri | |
puts [conf_name, conf_link].map {|e| e.to_s.strip}.to_csv | |
rescue Exception => e | |
e.message | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment