tags:

views:

55

answers:

3

Hello,

My problem originates from me trying to create names for all my crazy (brilliant?) ideas for business and products, which then need to have their purchasing availability checked for .com domain names.

So I have a pen and paper system where I create two lists of words... List A and List B for example.

I want to find or create a little app where I can create and store custom lists which takes each word from List A, appends each word from List B (to create a total of List A * List B results?)

After the list is compiled of "ListAListB" results, I want to check if the .com domain is available for purchase online via some other method...

And ultimately, create a new list of each combination, along with some sort of visual status like maybe a color or word representing if the combined word is available as a .com...

So I'm basically using a nested for loop structure to index each word in List A, Loop through each word in List B, and create List C? Then when the list is fully completed, send a CSV? to somewhere online and then somehow get a new list back. I guess that is my rough thought process.

Any advice in the algorithm to create the list from the two original lists is appreciated. Any help in the process to check the available domain names online via godaddy, ICANN, etc is appreciated.. Any help as to where I might find this tool already is even more appreciated..

I could probably download a free sdk or tool and write this in a language I suppose, based on my c++ experience from a few years ago, but I am rusty for sure, and haven't actually created anything since college like 3 years ago.

Thank you.

A: 

For checking if a domain you can give try this out:

Request this page:

http://instantdomainsearch.com/services/quick/?name=example

Which will return this json (u = unavailable, a = available)

{'name':'example','com':'a','net':'u','org':'a'}

Then you just need to parse it. You may get blocked if you are checking lots of domains but I doubt it since this site recieves a ton of request from one session so you should be good (I'd pause a 800 miliseconds between each request at least).

C# code for list creation:

// Load up all the lines of each list into string arrays
string[] listA = File.ReadAllLines("listA.txt"); 
string[] listB = File.ReadAllLines("listB.txt");

// Create a list to hold the combinations
List<string> listC = new List<string>();

// Loop through each line in listA
foreach(string buzzwordA in listA)
{
      // Now loop through each word in listB
      foreach(string buzzwordB in listB)
            listC.Add(buzzwordA + buzzwordB); // Combine them and add it to the listC
}

File.WriteAllLines("listC.txt", listC.ToArray()); // Save all the combos

I didn't check the code but thats the general idea. This is a bad idea for huge lists though because it reads the lists completely into memory at the same time. A better solution is probably reading the files line-by-line using FileStream and StreamReader

Edit (Same idea but this uses filestreams):

// Open up file streams for the lists
using(FileStream _listA = new FileStream("listA.txt", FileMode.Open, FileAccess.Read, FileShare.Read))
using(FileStream _listB = new FileStream("listB.txt", FileMode.Open, FileAccess.Read, FileShare.Read))
using(StreamReader listA = new StreamReader(_listA))
using(StreamReader listB = new StreamReader(_listB))
using(StreamWriter listC = new StreamWriter("listC.txt"))
{
         string buzzwordA = listA.ReadLine();
         while(buzzwordA != null)
         {
              string buzzwordB = listB.ReadLine();
              while(buzzwordB != null)
              {
                    listC.WriteLine(buzzwordA + buzzwordB);
                    buzzwordB = listB.ReadLine();
              }
              buzzwordA = listA.ReadLine();
              // reset the listB stream to the begining
              listB.BaseStream.Seek(0, SeekOrigin.Begin);
         }


} // All streams and readers are disposed by using statement

For parsing the json try this out: C# Json Parser Library

Chris T
quite helpful, thank you.Anyone have any insight as to the list creation portion of my scenario?
blair
Updated with C# example
Chris T
A: 

Thanks everyone for your responses. I'll be giving this a shot!!

blair
+2  A: 

Here's a quick shell script that leverages Chris's answer.

#!/bin/sh

ids_url="http://instantdomainsearch.com/services/quick/?name="

for a in $(< listA); do
   for b in $(< listB); do

      avail=`wget -qO- $ids_url$a$b | sed -e "s/.*'com':'u'.*//g"`

      if [ "$avail" == "" ]; then
         echo "$a$b.com unavailable"
      else
         echo "$a$b.com available"
      fi

   done
done

It iterates through both lists, hits the DNS service with wget and looks for any results that contain "'com':'a'". Supposing List A contains 'goo', 'foo', and 'arglbar' and List B contains 'gle', the output should look like this:

google.com unavailable
foogle.com unavailable
arglbargle.com available

Pipe it through grep -v unavail to see only the available names.

ladenedge