Skip to content

Instantly share code, notes, and snippets.

@ajbonner
Created February 9, 2013 16:23
Show Gist options
  • Save ajbonner/4745885 to your computer and use it in GitHub Desktop.
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
#!/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