Skip to content

Instantly share code, notes, and snippets.

@ox
Created September 8, 2011 02:51
Show Gist options
  • Save ox/1202491 to your computer and use it in GitHub Desktop.
Save ox/1202491 to your computer and use it in GitHub Desktop.
Grab the Latest Electro off Console.fm
['open-uri', 'hpricot'].each(&method(:require))
eval("Dir.mkdir %{s}; Dir.chdir %{s}" % {s:"\"electro-house\""})
(open("http://console.fm/electro-house") { |html| Hpricot(html) }).search("a[@href*=media.console.fm/tracks]").each do |a|
File.new("#{a.inner_html.gsub!(/[\s&\/',]/, "_")}.mp3", "w").puts(open(a.get_attribute('href')).read); puts "#{a.inner_html}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment