Created
January 11, 2010 11:40
-
-
Save sarahkadar/274174 to your computer and use it in GitHub Desktop.
This file contains 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
# 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