Skip to content

Instantly share code, notes, and snippets.

@fundaman123
Created September 14, 2008 04:48
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 fundaman123/10702 to your computer and use it in GitHub Desktop.
Save fundaman123/10702 to your computer and use it in GitHub Desktop.
Ubiquity - Checks if a site is down.
CmdUtils.CreateCommand({
name: "site-down",
icon: "http://downforeveryoneorjustme.com/favicon.ico",
author: {name: "Pratham Kumar", email: "pratham@pratham.name"},
description: "Checks if a site is down.",
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://downforeveryoneorjustme.com/'+q.text, params, function (data) {
var regex = new RegExp (".*class.*", "gi");
line = regex.exec (data);
html.innerHTML = line [0];
});
},
execute: function (q) {
var url = "http://downforeveryoneorjustme.com/"+q.text;
Utils.openUrlInBrowser (url);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment