Skip to content

Instantly share code, notes, and snippets.

@KTamas
Created January 11, 2010 11:40
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 KTamas/274174 to your computer and use it in GitHub Desktop.
Save KTamas/274174 to your computer and use it in GitHub Desktop.
# yeah there might be an even easier way but this was put together really quick and all
require 'rubygems'
require 'nokogiri'
require 'open-uri'
shiturl = "http://www.cloneshit.hu/category/podcast/page/"
gotit = []
[1, 2, 3, 4, 5].each do |page|
page = Nokogiri(open("#{shiturl}#{page}"))
(page/'div[@class="postcontent"]'/:a).each do |item|
url = item.attribute('href').inner_text
['mp3', 'm4a'].each do |ext|
system("wget #{url}") if url.include?(ext) && !gotit.include?(url)
gotit.push(url)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment