Skip to content

Instantly share code, notes, and snippets.

@jasonong
Created August 5, 2009 00:37
Show Gist options
  • Save jasonong/162401 to your computer and use it in GitHub Desktop.
Save jasonong/162401 to your computer and use it in GitHub Desktop.
CmdUtils.CreateCommand({
names: ["objectliteral"],
icon: "http://www.blogger.com/favicon.ico",
description: "Shortcut to my blog.",
help: "list, create or search",
author: {name: "Jason Ong", email: "velvetpd@gmail.com"},
license: "GPL",
homepage: "http://objectliteral.blogspot.com",
arguments: [{role: 'object', nountype: noun_arb_text}],
urls: {
home: "http://objectliteral.blogspot.com/",
list: "http://www.blogger.com/posts.g?blogID=3898581946541844969",
create: "http://www.blogger.com/post-create.g?blogID=3898581946541844969",
template: "http://www.blogger.com/html?blogID=3898581946541844969",
search: "http://objectliteral.blogspot.com/search?q="
},
preview: function preview(pblock, args) {
pblock.innerHTML = "objectliteral: <b>" + args.object.html + "</b>.";
},
execute: function execute(args) {
var words = args.object.text;
var queries = words.split(' ');
var key = queries[0];
var query = queries[1];
var link = this.urls[key];
if (link != null) {
var url = link;
if (query != null) {
url += query;
};
Utils.openUrlInBrowser(url);
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment