Created
November 27, 2008 02:43
-
-
Save elecnix/29671 to your computer and use it in GitHub Desktop.
Downloads podcast.rubyonrails.org audio archive.
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
require 'rubygems' | |
require 'mechanize' | |
require 'net/http' | |
agent = WWW::Mechanize.new do |a| | |
a.user_agent_alias = 'Mac Safari' | |
end | |
archive = agent.get("http://podcast.rubyonrails.org/programs/1/transcripts") | |
episodes = archive.links.select do |link| | |
link.uri.to_s.include? "/episodes/" | |
end | |
episodes.each do |link| | |
puts link.uri | |
episode = agent.get(link.uri) | |
audio = episode.links.select {|link| link.uri.to_s.include? ".mp3" }[0] | |
`wget -q -N #{audio.uri}` | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment