fREWdiculous!
19 Aug
So yesterday I spent a few hours trying to find a cool domain for the project I am working on in my free time. (By the way, raptorprey.com is open.) After looking at lots of various options, I decided that it would be really cool to get a domain of a latin work with the .US TLD. Too bad I don’t know latin right?
So I went online and found some cheesy one page latin dictionary that had a few thousand words. I used vim to clean up the data (after saving as plain text) and turn it into a standard format (JSON.) Next I used vim to filter out all the words that didn’t end in us. To do that I used a command something like the following:
1 | :g!/^".*us"/d |
That will find all lines that have words that don’t end in us, and then delete them. Then I wrote a perl script which would do it’s best to read in my serialized data, check if the domain was available, and store whether it was or not. Here’s a permutation of it (I changed it a lot and I left out the domain checking, as that’s technically Against The Rules):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | #!perl use Modern::Perl; # just for one-off's in my mind use JSON; use File::Slurp; # again, just for a one-off my $file = shift; my $text = read_file($file); #format: #my $final_data = { # unchecked => \%new_data, # possible => [], # unpossible => [], #}; my $final_data = from_json($text); foreach my $domain (keys %{$final_data->{unchecked}}) { warn "checking $domain.us"; # MAGIC HERE if ($exists) { push @{$final_data->{unpossible}}, "$domain.us"; } else { push @{$final_data->{possible}}, "$domain.us"; } delete $final_data->{unchecked}->{$domain}; sleep 1 + rand(); } END { my $json = JSON->new->pretty; say $json->encode($final_data); }; |
I have the end block doing the final output because something was killing the program, even if I put an eval around that part of the code, so what I did was basically output the same format that I input. That way I could just manually edit the data that was causing the issues.
Cool huh?
5 Responses for "Finding a sweet domain with perl"
[...] fREW Schmidt wrote an interesting post today onFinding a sweet <b>domain</b> with perlHere’s a quick excerpt [...]
So did you find a good domain? And what’s the project?
@Fjord: It’s a secret for now, but I did find a quite excellent (in my mind) domain. I’ll let you know when I have it ready (soon!)
Pretty sweet! I figured I’d check this out myself and found something interesting. 60% of the words are already registered and 1/10th of the domains, which unfortunately are most of the awesome ones, are parked (mostly by the same few companies).
It’s frustrating when good domains go to waste.
P.S. You should have registered your domain through your hosting provider. They have free privacy protection and are the same price. I like your domain though.
@Colin: This domain (afoolishmanifsto) is through my hosting provider. The problem is that they can’t register .us TLD’s, otherwise I would have gone through them.
Leave a reply