Skip to content

Instantly share code, notes, and snippets.

@marcus
Created October 24, 2009 02:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcus/217334 to your computer and use it in GitHub Desktop.
Save marcus/217334 to your computer and use it in GitHub Desktop.
# wget --user-agent="" -e robots=off --wait 1 -r -l inf -k -nc http://toneway.com/songs
filenames = Dir.open('songs').entries.map{|f|"songs/#{f}"}
filenames.each{|file|
if file.length > 9
File.open("#{file}") { |file|
file.each do |l|
fname = l.match(/flashvars:"file=(.+)&display/)
if fname
puts "Getting http://www.toneway.com#{fname[1]}"
`cd mp3s && wget http://www.toneway.com#{fname[1]}`
end
end
}
end
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment