Skip to content

Instantly share code, notes, and snippets.

@ironsand
Created June 2, 2014 08:17
Show Gist options
  • Select an option

  • Save ironsand/a6a4bbc01ad7807c6b4e to your computer and use it in GitHub Desktop.

Select an option

Save ironsand/a6a4bbc01ad7807c6b4e to your computer and use it in GitHub Desktop.
dotinstallから動画をまとめてダウンロードを途中でめんどくさくなってやめたスクリプト
require 'nokogiri'
require 'open-uri'
require 'selenium-webdriver'
driver = Selenium::WebDriver.for :firefox
doc = Nokogiri::HTML open ARGV[0]
urls = doc.search("a.lesson_title").map{|n| n['href']}
vimeo_urls = urls.map do |url|
driver.navigate.to "http://dotinstall.com#{url}"
doc = driver.page_source
doc.css("iframe#vimeo_player").first[:src]
end
vimeo_urls.each{|url| $stdout.puts url }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment