Skip to content

Instantly share code, notes, and snippets.

@gyng
Created August 3, 2011 06:04
Show Gist options
  • Save gyng/1122008 to your computer and use it in GitHub Desktop.
Save gyng/1122008 to your computer and use it in GitHub Desktop.
directory = Dir.entries('.')
output_file = "links.txt"
links = []
directory.each { |filename|
if File.directory?(filename)
next
else
source = File.open(filename).readlines
source.each { |line|
matches = line.match(/http.*?\.torrent/)
links.push matches if (matches != false && matches != nil)
}
end
}
f = File.open(output_file, 'r+')
f.puts links
f.close
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment