Skip to content

Instantly share code, notes, and snippets.

@lkraider
Created February 6, 2009 06:27
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 lkraider/59254 to your computer and use it in GitHub Desktop.
Save lkraider/59254 to your computer and use it in GitHub Desktop.
Ubiquity I'm Feeling Lucky google search
/* Based on Royall's original quicky script:
* http://gist.github.com/16507
*/
CmdUtils.CreateCommand({
name: "quicky",
icon: "http://www.google.com/favicon.ico",
homepage: "http://lkraider.eipper.com.br/ubiquity",
author: { name: "Paul Eipper", email: "paul@eipper.com.br"},
license: "GPL",
description: "Perform an I'm Feeling Lucky google search on the preview pane",
help: "just type the search terms",
takes: {"input": noun_arb_text},
preview: function( pblock, input ) {
var searchTerm = input.text;
if (input.text.length == 0) {
pblock.innerHTML = "<b>Please enter a search term</b>";
return;
}
var h = "http://www.google.com/search?ie=utf-8&btnI=&q=" + searchTerm;
//CmdUtils.renderTemplate(template, h);
var msg = "<iframe src='" + h + "' style='width:100%;height:100%;min-width:400px;min-height:400px;' />";
pblock.innerHTML = msg;
},
execute: function(input) {
Utils.openUrlInBrowser("http://www.google.com/search?ie=utf-8&btnI=&q=" + searchTerm);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment