-
-
Save rrichards/212614 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CmdUtils.CreateCommand({ | |
name: "search-domain-name", | |
icon: "http://instantdomainsearch.com/favicon.ico", | |
author: {name: "Pratham Kumar", email: "[email protected]"}, | |
description: "Checks availabilty of the domain name with com/net/org TLDs.", | |
homepage: "http://pratham.name/", | |
takes: {"example.com": noun_arb_text}, | |
preview: function (html, q) { | |
var params = {name: q.text}; | |
html.innerHTML = 'Searching for <b>'+q.text+'</b>'; | |
jQuery.get ('http://instantdomainsearch.com/services/rest/', params, function (data) { | |
data = eval ('('+data+')'); | |
var name = data ['name']; | |
html.innerHTML = name + ' - <a style="color:'+(data ['com'] == 'a' ? 'green' : 'red')+'" href="http://'+name+'.com/">com</b> <a href="http://'+name+'.net/" style="color:'+(data ['net'] == 'a' ? 'green' : 'red')+'">net</a> <a href="http://'+name+'.org/" style="color:'+(data ['org'] == 'a' ? 'green' : 'red')+'">org</a>'; | |
}); | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment