Skip to content

Instantly share code, notes, and snippets.

@DGaffney
Created March 22, 2013 21:48
Show Gist options
  • Select an option

  • Save DGaffney/5225046 to your computer and use it in GitHub Desktop.

Select an option

Save DGaffney/5225046 to your computer and use it in GitHub Desktop.
require 'open-uri'
require 'nokogiri'
url = "http://www.enxing.de/audio.html"
result = Nokogiri.parse(open(url))
mp3s = result.search("option").collect{|option| option.attributes["value"].value}.select{|link| link.include?(".mp3")}
mp3s.each do |mp3|
Thread.new{puts `wget #{mp3}`}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment