Skip to content

Instantly share code, notes, and snippets.

@kwijibo
Created April 28, 2009 17:01
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 kwijibo/103266 to your computer and use it in GitHub Desktop.
Save kwijibo/103266 to your computer and use it in GitHub Desktop.
prefix.cc lookup ubiquity command
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);
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment