Created
September 8, 2011 02:51
-
-
Save ox/1202491 to your computer and use it in GitHub Desktop.
Grab the Latest Electro off Console.fm
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
['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