Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mumoshu/25202 to your computer and use it in GitHub Desktop.
Save mumoshu/25202 to your computer and use it in GitHub Desktop.
{method: "POST"} ver.
CmdUtils.CreateCommand({
name: "search-template-with-createcommand",
takes: {query: noun_arb_text},
url: "http://www.google.co.jp/search",
preview: function(pBlock, directObject) {
var query = directObject.text;
Utils.parseRemoteDocument(
this.url,
{q: query},
function(doc) {
jQuery('li.g',doc).each(function() {
pBlock.innerHTML += this.innerHTML;
});
}
);
},
execute: function(directObject) {
var query = directObject.text;
Utils.openUrlInBrowser(this.url, {q: query});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment