Created
March 4, 2011 18:09
-
-
Save samanthamjohn/855420 to your computer and use it in GitHub Desktop.
A script to generate potential domain names.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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