pratham (owner)

Forks

Revisions

gist: 10703 Download_button fork
public
Description:
Ubiquity - Check the Web Host.
Public Clone URL: git://gist.github.com/10703.git
Embed All Files: show embed
JavaScript #
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
CmdUtils.CreateCommand({
  name: "host",
  icon: "http://www.whoishostingthis.com/favicon.ico",
  author: {name: "Pratham Kumar", email: "pratham@pratham.name"},
  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);
  }
});