public
Last active

prefix.cc lookup ubiquity command

  • Download Gist
x
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 26 27 28 29 30 31
CmdUtils.CreateCommand({
name: "prefix",
takes: {"term": noun_arb_text},
homepage: "http://kwijibo.talis.com/",
author: { name: "Keith Alexander", email: "keith.alexander@talis.com"},
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);
}
})

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.