Skip to content

Instantly share code, notes, and snippets.

@yoshimov
Created September 7, 2011 09:33
Show Gist options
  • Select an option

  • Save yoshimov/1200153 to your computer and use it in GitHub Desktop.

Select an option

Save yoshimov/1200153 to your computer and use it in GitHub Desktop.
CmdUtils.CreateCommand({
names: ["search with sparks", "sparks"],
description: "Search news from Google Sparks.",
help: "Select text and execute this command.",
author: {
name: "NOMURA Yoshihide",
email: "nomura@pobox.com",
homepage: "http://yoshimov.com/",
},
license: "GPL",
homepage: "http://yoshimov.com/",
icon: "http://yoshimov.com/favicon.ico",
arguments: [{role: "object", nountype: noun_arb_text, label: "text"}],
execute: function execute(args) {
var url = "https://plus.google.com/sparks/interests/" + args.object.text;
Utils.openUrlInBrowser(url);
},
preview: function preview(pblock, args) {
pblock.innerHTML = "Search " + args.object.html.bold() + ".";
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment