talsafran/domainr — pull request #7 by connormontgomery (2012-04-23 19:48:29+00:00)
Title: Added ability to register domains from CLI

Sorry about the multiple PR's earlier - I always thought I had it working great, but then would find a case where it wouldn't.

This now does work great. Below are some test cases to prove it:

### checking multiple domains

![checking multiple domains](http://f.cl.ly/items/3u3h3f1246262p2Y0Y2j/Screen%20Shot%202012-04-23%20at%202.34.45%20PM.png)

### registering a domain

The following is brought up when running `domainr register 7`, corresponding to **tals.af**:

![registering tals.af](http://f.cl.ly/items/3T3x3s2H0Z0l23282i2t/Screen%20Shot%202012-04-23%20at%202.35.05%20PM.png)

Okay, great. So that works. But what about checking just one domain?

### checking one domain

![checking one domain](http://f.cl.ly/items/2O0x2U342o3k2F2O3k0T/Screen%20Shot%202012-04-23%20at%202.35.16%20PM.png)

and, running `domainr register 11` opens up the following tab:

![registering a single domain](http://f.cl.ly/items/3j0q301f3l1h221J3N2X/Screen%20Shot%202012-04-23%20at%202.35.29%20PM.png)

awesome.

But now, what if the user is looking for a domain that includes the word "register"? Not a problem.

![looking up several domains with the register keyword](http://f.cl.ly/items/1X2o2Z1V1f3l2x073m2i/Screen%20Shot%202012-04-23%20at%202.37.00%20PM.png)

---

The way this works is it creates a `/usr/local/bin/_domainr/logs.txt` file (so, a `logs.txt` file in a `_domainr` directory where you installed the `domainr` CLI). Then each time you search for domains, it replaces the content with that txt file with the available domains, and allows you to use that dictionary to register a domain.

Again, apologies about the sloppy PR's before. If the spacing needs to be different, let me know. I'm mostly a JS/Ruby guy, but I went ahead and made it 4-space indents like you had previously.

\cc @case