Skip to content

Instantly share code, notes, and snippets.

@samanthamjohn
Created March 4, 2011 18:09
Show Gist options
  • Save samanthamjohn/855420 to your computer and use it in GitHub Desktop.
Save samanthamjohn/855420 to your computer and use it in GitHub Desktop.
A script to generate potential domain names.
#! /usr/bin/env ruby
root_word = ARGV[0] || ''
word_size = ARGV[1].to_i
word_size = 3 if word_size == 0
domain_names = []
dictionary = File.read('/usr/share/dict/words').split("\n").select{|d| d.size == word_size}
dictionary.each do |word|
domain_names.push("#{word}#{root_word}.com")
end
system("touch #{root_word}.txt")
names = File.open("#{root_word}.txt", 'w')
domain_names.each do |name|
names.write("#{name}\n")
end
names.close
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment