Created
February 9, 2013 16:23
-
-
Save ajbonner/4745885 to your computer and use it in GitHub Desktop.
Script to pulldown all the Ruby Rogue Podcast MP3s as only the latest 50 are in their feed
This file contains hidden or 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
#!/usr/bin/env ruby | |
require 'nokogiri' | |
require 'open-uri' | |
index = Nokogiri::HTML(open('http://rubyrogues.com/episode-guide/')); | |
index.css('a[rel=bookmark]').each do |link| | |
podcast = Nokogiri::HTML(open(link['href'])); | |
title = podcast.css('.entry-title').text | |
clean_title = title.gsub(/[^a-zA-Z0-9]/, '-') + '.mp3' | |
clean_title.gsub!(/-{2,}/, '-') | |
download_link = podcast.css('a[title=Download]') | |
%x[wget -O '#{clean_title}' '#{download_link[0]['href']}'] | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment