Added the ability to register domains from CLI #6

wants to merge 8 commits into from

3 participants


I love the CLI, but sometimes I wish I could register them from it, too.

So, I made this so you can (kind of). I'm utilizing the webbrowser module, and just seeing if the user's first parameter is register. If It is, then I open up a new tab with the URL set as the registration URL for that domain.

Not the best code quality, but gets the job done ;)

Connor Montg... added some commits Apr 15, 2012

Awesome dude, thanks! I have a suggestion for a nicer interface.

WIth the original CLI, I like not having to pass in an actual address but a phrase. That's the fun part about domainr. I wonder if we can change the results of the domainr command to have numbered results for available domains.

  $ domainr talsafran
    Looking up domains for talsafran... - taken - available [1] - available [2] - available     [3] - available         [4] - available          [etc I am lazy :)] - available - unavailable - taken - unavailable - unavailable
        tl - tld

After each run, write those results to a file.

Then do something like domainr register 3 and it'll try to register What do you think?

I can hack on it this weekend but you're more than welcome to give it a crack first! :)


I'm totally down for this. Busy until tomorrow night, but should have some time :D


No presh, whenever you feel like it


Thanks for working on this, gents — lemme know when it's committed and we'll mention on @domainr.



Yep - not a problem fellas! Got it about 95% there - just need to log multiple arguments, ex:

$ domainr connormontgomery talsafran case

Working great for single domains passed in, though.

Connor Montg... added some commits Apr 20, 2012
Connor Montgomery better register workflow c5791a9
Connor Montgomery added example to readme 9650e04

Alright - there we go fellas. Should be pretty solid. I have tested it with several domains, and it's working great. Code quality isn't the best - I tried using descriptive variable names. Take a look and if it doesn't make sense to you, let me know!


Couldn't get this to work. :(

tal:~/Projects/connor/domainr $ ./domainr talsafran
Looking up domains for talsafran... - taken - available [1] - available [2] - unavailable - available [3] - available [4] - available [5] - taken - unavailable - unavailable - unavailable
    tl/sfrn - tld
tal:~/Projects/connor/domainr $ ./domainr register 1
Traceback (most recent call last):
  File "./domainr", line 169, in <module>
  File "./domainr", line 84, in main
    available_domain_data = ast.literal_eval("%s" % external_available_domains )
  File "/usr/local/Cellar/python/2.7.2/lib/python2.7/", line 49, in literal_eval
    node_or_string = parse(node_or_string, mode='eval')
  File "/usr/local/Cellar/python/2.7.2/lib/python2.7/", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 1
    {1: u'', 2: u'', 3: u'', 4: u'', 5: u''
SyntaxError: unexpected EOF while parsing

Also... spacing should be more consistent... need to appease the Python gods..


hmm interesting. was working fine for me, but I'll dig into it.

re: spacing - super apologies dude. will fix that up.


@talsafran fixed it up - I accidentally removed a line that added the closing } to the JSON that is stored. That's fixed, now just gotta get the white space all cleaned up.

Connor Montgomery now it's working. other notes:
-  made it 4 spaces per tab instead of 2.
- if second argument is 'register', and there is no number to register, it'll search for domains using 'register', like it should.

Don't pull this in yet. I was testing it and just found out it works only with 1 domain searches. Really sorry for this messy PR - i may just open up a clean new one when it's 100% done.

my bad dude.

Connor Montg... added some commits Apr 23, 2012
@connor connor closed this Apr 23, 2012

Closing to make it an easy PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment