Skip to content

Instantly share code, notes, and snippets.

@louismullie
Created April 15, 2012 01:48
Show Gist options
  • Save louismullie/2389285 to your computer and use it in GitHub Desktop.
Save louismullie/2389285 to your computer and use it in GitHub Desktop.
Expired Domain Name Catching Script
domain = "www.test.com"
email = "[email protected]"
password = "test"
require 'whois'
require 'gmail'
client = Whois::Client.new
while true
puts "Checked at #{Time.now.to_s}"
break if client.query(domain).available?
sleep 60
end
puts "Domain is now available!"
gmail = Gmail.new(email, password)
email = gmail.deliver do
to email
subject "Domain #{domain} has expired!"
body "The name you wanted is now available."
end
@louismullie
Copy link
Author

This script will check every minute if a domain is available or not, and will send you a G-mail message when the domain becomes available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment