Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.