Skip to content

Instantly share code, notes, and snippets.

@elecnix
Created November 27, 2008 02:43
Show Gist options
  • Save elecnix/29671 to your computer and use it in GitHub Desktop.
Save elecnix/29671 to your computer and use it in GitHub Desktop.
Downloads podcast.rubyonrails.org audio archive.
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