Skip to content

Instantly share code, notes, and snippets.

@jyt
Created July 27, 2009 14:25
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 jyt/156383 to your computer and use it in GitHub Desktop.
Save jyt/156383 to your computer and use it in GitHub Desktop.
CmdUtils.CreateCommand({
names: [ 'blogsearch', 'search blog'],
author: {name:"jyoti", email: "mail2jyoti88@gmail.com"},
description:"It will show the blogs according to the keyword specified by you.",
arguments: [ {role: 'object', nountype: noun_arb_text, label: 'keyword'}],
_func: function(term)
{
return "http://blogsearch.google.com/blogsearch?hl=en&ie=UTF-8&q="+term+"&btnG=Search+Blogs";
},
preview: function(pblock,args)
{
var msg="It will show the blogs related to the keyword "+ args.object.text;
pblock.innerHTML=msg;
},
execute: function(args)
{
if (args.text=="")
{
displayMessage("Enter some keyword atleast");
}
else
Utils.openUrlInBrowser(this._func(args.object.text));
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment