Skip to content

Instantly share code, notes, and snippets.

@ejdyksen
Last active August 6, 2020 15:02
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 ejdyksen/066b9f5a1f60669477d355532d2fef4b to your computer and use it in GitHub Desktop.
Save ejdyksen/066b9f5a1f60669477d355532d2fef4b to your computer and use it in GitHub Desktop.
A simple script to test if a website is responding to HTTP requests
#!/usr/bin/env ruby
loop do
good = 0
bad = 0
for i in 1..100 do
result = system("curl -sS https://www.google.com/ > /dev/null 2> /dev/null")
if result then
print "."
good = good + 1
else
print "x"
bad = bad + 1
end
end
puts
puts "Good: #{good}"
puts "Bad: #{bad}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment