Skip to content

Instantly share code, notes, and snippets.

@chaitu87
Created January 13, 2014 08:28
Show Gist options
  • Save chaitu87/8396552 to your computer and use it in GitHub Desktop.
Save chaitu87/8396552 to your computer and use it in GitHub Desktop.
Find domain name availability from terminal.
require 'rubygems'
require 'nokogiri'
require 'open-uri'
name = ARGV[0]
doc = Nokogiri::XML(open("http://www.whoisxmlapi.com/whoisserver/WhoisService?cmd=GET_DN_AVAILABILITY&domainName=" + name))
puts doc.at_xpath('//DomainInfo//domainAvailability').text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment