Skip to content

Instantly share code, notes, and snippets.

@rainly
Forked from saberma/domains.rb
Created March 17, 2011 10:10
Show Gist options
  • Save rainly/874101 to your computer and use it in GitHub Desktop.
Save rainly/874101 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
# sudo apt-get install libnotify-bin
# gem install bulkdom
# gem install notify
require 'bulkdom'
require 'notify'
letters = File.read('letters').chomp
size = letters.size
@dl = Bulkdom::DomainList.new
@dl.tlds = [".com"]
begin
File.open('letters', 'w') {|f| f.write(letters)}
domains_to_check = []
print '.'
begin
domains_to_check << letters
letters = letters.next
end until domains_to_check.size >= 26
#start check
print '.'
@dl.list = domains_to_check
@dl.process
#finish check
print '.'
#Let it process for a while... @dl.processed will be set to true when done!
result = @dl.return_available(".com")
unless result.empty?
puts result
Notify.notify "domain valid!", result.join("\n")
File.open('domains.log', 'a') do |f|
#f.write "#{Time.now}\n"
f.write result.join("\n")
end
end
end until letters.size > size
#http://www.heartinternet.co.uk/domain-names/domain-search.html?multi=1&domain=sina.com%0D%0Atwitter.com
base_url = 'http://www.heartinternet.co.uk/domain-names/domain-search.html?multi=1&domain='
scope = (:a..:z).to_a - [:f, :j, :l, :r, :w, :y, :z]
scope.each do |one|
domains = []
scope.each do |two|
#domains << "shop#{one}#{two}.com"
domains << "shop#{one}#{two}.com"
end
url = "#{base_url}#{domains.join('%0D%0A')}"
system "chromium-browser '#{url}'"
sleep 60
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment