Skip to content

Instantly share code, notes, and snippets.

@capotej
Created October 24, 2012 03:23
Show Gist options
  • Save capotej/3943491 to your computer and use it in GitHub Desktop.
Save capotej/3943491 to your computer and use it in GitHub Desktop.
require 'open-uri'
failed = []
File.read('File.txt').lines.each do |x|
begin
sleep 1
st = Time.now.to_f
puts "#{x}: #{open(x).status} in #{(et - st)}"
et = Time.now.to_f
rescue
failed << x
end
end
File.open('failed.txt', 'w') { |f| f.print failed.join("\n") }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment