Skip to content

Instantly share code, notes, and snippets.

@canadaduane
Created February 15, 2009 19:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save canadaduane/64825 to your computer and use it in GitHub Desktop.
Save canadaduane/64825 to your computer and use it in GitHub Desktop.
CmdUtils.CreateCommand({
name: "search-domain-name",
icon: "http://instantdomainsearch.com/favicon.ico",
author: {name: "Pratham Kumar", email: "pratham@pratham.name"},
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