-
-
Save kwijibo/103266 to your computer and use it in GitHub Desktop.
prefix.cc lookup ubiquity command
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: "prefix", | |
takes: {"term": noun_arb_text}, | |
homepage: "http://kwijibo.talis.com/", | |
author: { name: "Keith Alexander", email: "[email protected]"}, | |
license: "MPL", | |
description: "performs a lookup on prefix.cc (http://prefix.cc/)", | |
preview: function(previewBlock, term) { | |
previewBlock.innerHTML = "looking up " + term.text ; | |
var baseURI = "http://prefix.cc/" + term.text; | |
jQuery.ajax({ | |
type: "GET", | |
url: baseURI, | |
datatype: "string", | |
error: function(responseData) { | |
previewBlock.innerHTML = "<em>Error:" + responseData + "</em>"; | |
}, | |
success: function(responseData) { | |
previewBlock.innerHTML = responseData; } | |
}); | |
}, | |
execute: function(term) { | |
Utils.openUrlInBrowser("http://prefix.cc/" + term.text); | |
} | |
}) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment