Created
September 14, 2008 04:48
-
-
Save fundaman123/10702 to your computer and use it in GitHub Desktop.
Ubiquity - Checks if a site is down.
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: "site-down", | |
icon: "http://downforeveryoneorjustme.com/favicon.ico", | |
author: {name: "Pratham Kumar", email: "[email protected]"}, | |
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