Skip to content

Instantly share code, notes, and snippets.

@ba3r
Created December 18, 2009 10:54
Show Gist options
  • Save ba3r/259436 to your computer and use it in GitHub Desktop.
Save ba3r/259436 to your computer and use it in GitHub Desktop.
//codeorgan v0.3
CmdUtils.CreateCommand({
names: ["codeorgan"],
description: "Translates web sites into music",
help: "",
author: {
name: "Michael Baer",
email: "sy.na.ps.os@gmail.com",
homepage: "http://twitter.com/synapsos",
},
license: "GPL",
homepage: "http://www.codeorgan.com/",
icon: "http://www.mozilla.com/favicon.ico",
arguments: [{role: "object", nountype: noun_type_url , label: "site"}],
execute: function execute(args) {
Utils.openUrlInBrowser("http://www.codeorgan.com/?url=" + args.object.text);
},
preview: function preview(pblock, args) {
var u = args.object.text;
var fb = encodeURIComponent("http://www.facebook.com/sharer.php?u=http://www.codeorgan.com/?url="+u+"&t=TITLE");
var tw = encodeURIComponent("http://twitter.com/?status=If this page took a shower, this is what it would sing: http://www.codeorgan.com/?url="+u+" #codeorgan");
pblock.innerHTML = "<p>\"Translate\" " + u.bold() + " into music.</p>"
+ "<p>Share Your Music<br/>"
+ " <a href=\""+fb+"\" title=\"Facebook\"><img src=\"http://facebook.com/favicon.ico\"/></a>"
+ " <a href=\""+tw+"\" title=\"Twitter\"><img src=\"chrome://ubiquity/skin/icons/twitter.ico\"/></a></p>";
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment