Skip to content

Instantly share code, notes, and snippets.

@EnriqueCanals
Created October 24, 2012 03:21
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 EnriqueCanals/3943482 to your computer and use it in GitHub Desktop.
Save EnriqueCanals/3943482 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 }"
et = Time.now.to_f
puts (et - st)
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