Skip to content

Instantly share code, notes, and snippets.

@FooBarWidget
Created September 5, 2015 04:27
Show Gist options
  • Save FooBarWidget/6320586aa80b128780c4 to your computer and use it in GitHub Desktop.
Save FooBarWidget/6320586aa80b128780c4 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'net/http'
require 'uri'
i = 0
while true
begin
i += 1
puts "#{Time.now}: Pinging #{i}"
Net::HTTP.get(URI('http://izumi.plan99.net/reload.html'))
puts " => OK"
sleep 10
rescue SystemCallError, IOError, SocketError, Timeout::Error => e
puts " => Error: #{e}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment