Skip to content

Instantly share code, notes, and snippets.

CmdUtils.CreateCommand({
names: ["fb-friend", "facebook-friend"],
arguments: [{ role: "object", nountype: noun_arb_text, label: "your friend"}],
execute: function(arguments) {
Utils.openUrlInBrowser('http://www.facebook.com/srch.php?nm='+arguments.object.text);
},
});
CmdUtils.CreateCommand({
names: ["fb-friend", "facebook-friend"],
arguments: [{ role: "object", nountype: noun_arb_text, label: "your friend"}],
execute: function(arguments) {
var params = {view: 'search', q: arguments.object.text};
jQuery.get("http://new.facebook.com/friends/ajax/friends.php", params, function(fbjson) {
var re = /id=\\"f(\d+)/;
var res = re.exec(fbjson);
if (res && res[1] > 0) {
/* This is a template command. */
CmdUtils.CreateCommand({
names: ["example"],
description: "A short description of your command.",
help: "How to use your command.",
execute: function execute(args) {
displayMessage("You selected: " + Utils.OS , this);
}
});
@gattu
gattu / x
Created October 31, 2008 14:43
CmdUtils.CreateCommand({
author: { name: "Aman", email: "amanatiitATgmail.com"},
license: "GPL",
description: _("Opens MS Paint. Currently works with Windows only"),
name: ['paint'],
arguments: [],
execute: function(args) {
var process = Components.classes["@mozilla.org/process/util;1"].createInstance(Components.interfaces.nsIProcess);
var path = "c:\\windows\\system32\\mspaint.exe";
var args = path.split(" ");
@gattu
gattu / x
Created October 31, 2008 14:12
Ubiquity command for opening Notepad application from Firefox (on Windows only)
CmdUtils.CreateCommand({
author: { name: "Aman Bhatia", email: "amanatiitATgmail.com"},
license: "MPL",
description: _("Opens Notepad. Currently works with Windows only"),
name: ['notepad', 'notes'],
arguments: [],
execute: function(args) {
var process = Components.classes["@mozilla.org/process/util;1"].createInstance(Components.interfaces.nsIProcess);
var path = "c:\\windows\\notepad.exe";
var args = path.split(" ");