Skip to content

Instantly share code, notes, and snippets.

@harlemblues
Created July 10, 2009 23:46
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save harlemblues/144913 to your computer and use it in GitHub Desktop.
Save harlemblues/144913 to your computer and use it in GitHub Desktop.
TheFreeDictionary.com - Gives the meaning of a word, in a given language
Components.utils.import("resource://ubiquity/modules/setup.js");
const defaultLang = UbiquitySetup.languageCode;
CmdUtils.CreateCommand({
names: ["TFD", "TheFreeDictionary"],
arguments: [{role: "object",
nountype: noun_arb_text,
label: "word"},
{role: "format",
nountype: noun_type_lang_wikipedia,
label: "language"}],
locale: "en-US",
homepage: "http://www.thefreedictionary.com/",
author: {name: "harlemblues", email: ""},
license: "MPL",
icon: "http://www.thefreedictionary.com/favicon.ico",
description: "Gives the meaning of a word, in a given language, using TheFreeDictionary",
execute: function(arguments) {
var lang = arguments.format.data || defaultLang;
var searchUrl = "http://" + lang + ".thefreedictionary.com/";
var searchParams = arguments.object.text;
Utils.openUrlInBrowser(searchUrl + searchParams);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment