Skip to content

Instantly share code, notes, and snippets.

@cthrax
Created July 10, 2009 15:06
Show Gist options
  • Save cthrax/144575 to your computer and use it in GitHub Desktop.
Save cthrax/144575 to your computer and use it in GitHub Desktop.
dictionary.com ubiquity command for parser v1
/* command "define" */
CmdUtils.CreateCommand({
name: "define",
icon: "http://dictionary1.classic.reference.com/favicon.ico",
homepage: "http://dictionary.com",
author: { name: "Myles Bostwick", email: "ubiquity@zithora.com"},
license: "GPL",
description: "Search Dictionary.com",
help: "define: your word",
takes: {"input": noun_arb_text},
baseurl: "http://dictionary.reference.com/browse/",
execute:function(direct_obj){
var input = Utils.trim(direct_obj.text);
var url = this.baseurl + encodeURIComponent(input);
Utils.openUrlInBrowser(url);
},
preview: function( pblock, direct_obj) {
pblock.innerHTML = "<p>No Preview at this time.</p>";
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment