« Word of the Day - Marketecture | Main | 35 links from 23 sources »

February 10, 2005

Single-Letter Domain Names

This article about single-letter ticker names made me think about single-letter domain names.

I know these used to be a hot commodity, but a few random checks revealed most are not around anymore. So I wrote a script in Monad to check on them:

[int]$n = [char]"a"
while ($n -le [char]"z") {
    trap [System.Net.WebException] {
        continue
    }
    $c = [System.Convert]::ToChar($n)
    $url = "http://www." + $c + ".com"

    $a = new-object System.Net.WebClient
    $s = $null
    $s = $a.OpenRead($url)
    if ($s -is [System.IO.Stream]) {
        write-host ($url + ":")
        $sr = new-object System.IO.StreamReader $s
        while (!$sr.EndOfStream) {
            $l = $sr.ReadLine()
            if ($l -like "*<title>*</title>*") {
                write-host $l
                break
            }
        }
    }

    $n = $n + 1
}

It gets the contents of the site, if it exists, and then scans for the <title> line and prints it (there may be easier ways of doing this, but it seems to work). The results:

http://www.q.com:
<title>Qwest Communications phone company with Internet, wireless and VoIP service</title>
http://www.x.com:
<title>PayPal - Welcome</title>
http://www.z.com:
         <title>Nissan Vehicles -   2005 Z&reg;</title>

These are the same three that J-Walk found a few years ago. Here's a bit of discussion about the single-letter domains -- they used to be obtainable, but now they can only be renewed, no new registrations.

Posted by AdamBa at February 10, 2005 09:48 PM

Trackback Pings

TrackBack URL for this entry:
http://proudlyserving.com/cgi-bin/mt-tb.cgi/153

Comments

What an ugly language (IMHO) ;)

Posted by: Alex at February 11, 2005 05:07 AM

This is the first I've seen of Monad, but I like what I see.

I just hope they get the security implications right in the RTM version as opposed to SP1.

Posted by: KB at February 11, 2005 04:51 PM

Gee Alex, I think it's beautiful...

It depends on what you compare it to, of course, but it looks a lot like similar scripting languages. There is a bit of wordiness in how you access the .Net objects, but of course that adds immensely to the power of the language.

- adam

Posted by: Adam Barr at February 11, 2005 06:20 PM

Nifty script but it seems to break on build 4093. Did you code it up using one of the more recent builds?

What I like about MSH is that it is unique. It doesn't look like Perl or Bourne shell or DCL. To be sure, it's got comparable features to all of those (and more), but it is definitely it's own unique thing. I use it every day. ;-)

Ramsey

Posted by: Ramsey at February 14, 2005 10:20 PM

The language probably has changed slightly. One thing I can think of is that on older builds you wrote

[System.Convert].ToChar($n)

instead of

[System.Convert]::ToChar($n)

If you send me the error, I can tell you more.

- adam

Posted by: Adam Barr at February 15, 2005 11:23 PM

Works for me, with the fix you wrote in the comments. However, the 'trap' statement doesn't work :(. I've tried to move it around, but I always get "Exception calling method "OpenRead" with "1" argument(s): "The remote name could
not be resolved".". Is this some bug which has been fixed since august/september maybe?

I also extended the script a little bit, since there are lot's of other single-character domains available. Just add the following around the first while-loop, and change +".com" where $url is set to +$fix :). Of course the $fixes array is not complete, since ".nl", ".jp", etc are missing. Woho.. a little MSH-scripting in the morning makes a great start for the day! (Alex, you're wrong! ;))

[array]$fixes = ".com", ".org", ".no", ".info", ".museum", ".name", ".de", ".us", ".com.au", ".aero", ".biz", ".coop", ".net", ".pro"
foreach ($fix in $fixes) {

}

btw. the array is named 'fixes' from 'postfix', didn't bother to look up the DNS RFC to find out what the real name is...

Posted by: Andreas Häber at March 1, 2005 02:20 PM

Andreas, you may be running on a version of Whidbey that throws a different exception in that case. See what $error[0].Exception.GetType() tells you.

Or maybe the trap syntax has changed...or maybe trap wasn't implemented back then (although I think it was?). Sorry, it is hard for me to think back to what was done when.

- adam

Posted by: Adam Barr at March 2, 2005 11:43 AM