Created
September 14, 2008 04:49
-
-
Save fundaman123/10703 to your computer and use it in GitHub Desktop.
Ubiquity - Check the Web Host.
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: "host", | |
icon: "http://www.whoishostingthis.com/favicon.ico", | |
author: {name: "Pratham Kumar", email: "[email protected]"}, | |
description: "Check the web host of any site.", | |
homepage: "http://pratham.name/", | |
takes: {"example.com": noun_arb_text}, | |
preview: function (html, q) { | |
var params = {}; | |
html.innerHTML = 'Checking <b>'+q.text+'</b>'; | |
jQuery.get ('http://www.whoishostingthis.com/'+q.text, params, function (data) { | |
var regex = new RegExp ("<h3>.*<\/h3>", "gi"); | |
line = regex.exec (data); | |
html.innerHTML = line [0]; | |
}); | |
}, | |
execute: function (q) { | |
var url = "http://www.whoishostingthis.com/"+q.text; | |
Utils.openUrlInBrowser (url); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment