There are 3 previous versions of this script.
// ==UserScript==
// @name SearchJump
// @description Allows you to jump quickly between search results on different engines.
// ==/UserScript==
// Modifications
// ---------------------------------
// searchenginearray[i][0] - Search engine name
// searchenginearray[i][1] - Querystring variable key for keywords entered
// searchenginearray[i][2] - URL portion identifying search from this engine
// searchenginearray[i][3] - Search URL ("--keywords--" to be replaced by searched-for keywords)
// searchenginearray[i][4] - Whether to show this engine in list or not
// searchenginearray[i][5] - Search engine favicon
(function() {
var searchenginearray = new Array();
var lg = new Array();
searchenginearray[0] = new Array('B', 'q', 'google.', 'http://search.msn.com/results.aspx?q=--keywords--&FORM=QBHP', 1, 'http://search.msn.com/favicon.ico');
searchenginearray[1] = new Array('A', 'q', 'ask.', 'http://web.ask.com/web?q=--keywords--&qsrc=0&o=0', 1, 'http://www.ask.com/favicon.ico');
searchenginearray[2] = new Array('Y', 'p', 'google.', 'http://search.yahoo.com/search/dir?p=--keywords--', 0, 'http://www.yahoo.com/favicon.ico');
searchenginearray[3] = new Array('DM', 'search', 'google.', 'http://search.dmoz.org/cgi-bin/search?search=--keywords--', 1, 'http://dmoz.org/favicon.ico');
searchenginearray[4] = new Array('Ch', '', 'google.', 'http://www.chacha.com/search/--keywords--', 1, 'http://www.chacha.com/favicon.ico');
searchenginearray[5] = new Array('Z', 'st', 'google.', 'http://www.zuula.com/SearchResult.jsp?bst=1&prefpg=1&st=--keywords--&x=0&y=0', 1, 'http://www.zuula.com/favicon.ico');
searchenginearray[6] = new Array('Cl', 'query', 'clusty.', 'http://clusty.com/search?input-form=clusty-simple&v%3Asources=webplus&query=--keywords--', 1, 'http://www.clusty.com/images/clusty-favicon.ico');
searchenginearray[7] = new Array('W', 'i', 'google.', 'http://www01.wolframalpha.com/input/?i=--keywords--', 1, 'http://www.wolframalpha.com/favicon.ico');
searchenginearray[8] = new Array('s', 'q', 'google.', 'http://www.searchme.com/lite/?q=--keywords--', 0, 'http://www.searchme.com/favicon.ico');
searchenginearray[9] = new Array('F', 'query', 'go.footnote.', 'http://go.footnote.com/results.php?query=--keywords--&vs=1&s_given-name=&s_surname=>eq_year=<eq_year=&s_place=', 1, 'http://go.footnote.com/favicon.ico');
searchenginearray[10] = new Array('S', '', 'google.', 'http://www.scour.com/search/web/--keywords--', 1, 'http://www.scour.com/favicon.ico');
searchenginearray[11] = new Array('V', '', 'google.', 'http://www.viewzi.com/search/power_grid/--keywords--', 1, 'http://www.viewzi.com/favicon.ico');
searchenginearray[12] = new Array('De', 'p', 'google.', 'http://delicious.com/search?p=--keywords--&u=&chk=&context=&fr=del_icio_us&lc=0', 1, 'http://delicious.com/favicon.ico');
searchenginearray[13] = new Array('Q', 'request', 'google.', 'http://quintura.com/?request=--keywords--&lng=en&r1=from&r2=browser', 1, 'http://quintura.com/favicon.ico');
searchenginearray[14] = new Array('De', 'query', 'google.', 'http://www.deepdyve.com/search?query=--keywords--&subjectArea[]=wikipedia&subjectArea[]=clean_technology_and_energy&subjectArea[]=it_and_engineering&subjectArea[]=web&subjectArea[]=other', 1, 'http://deepdyve.com/favicon.ico');
searchenginearray[15] = new Array('K', '', 'google.', 'http://www.kosmix.com/topic/--keywords--', 1, 'http://kosmix.com/favicon.png');
searchenginearray[16] = new Array('G', 'q', 'google.', 'http://www.google.com/squared/search?q=--keywords--', 1, 'http://google.com/favicon.ico');
searchenginearray[17] = new Array('b', '', 'google.', 'http://www.blinkx.com/videos/--keywords--', 0, 'http://blinkx.com/favicon.ico');
searchenginearray.sort();
var r = escape(document.referrer);
var u = escape(document.location.href);
var b = document.getElementById("searchSideBar");
var d = document.location.host;
var q = document.location.search;
var e = -1;
var t = '';
var keywords = '';
var qvar;
var linkstyle = '';
for (i = 0; i < searchenginearray.length; i++) {
t = searchenginearray[i][2];
if (d.indexOf(t) != -1) {
e = i;
}
}
q = q.slice(1);
if ((q.length > 0) && (e != -1)) {
// There's a querystring and it's a search referral
var qspairs = q.split('&');
for (k = 0; k < qspairs.length; k++) {
qvar = qspairs[k].split('=');
if (qvar[0] == searchenginearray[e][1]) {
qvar[0] = '';
keywords = qvar.join('=').slice(1);
}
}
}
function make_boxes() {
if ((!b) && (keywords != '')) {
b = document.createElement("div");
b.setAttribute("id","searchSideBar");
b.setAttribute("style","position: fixed; bottom: 20px; right: 0; padding: 3px 0; background: #eee; border: 1px solid #ccc; border-right: 0; width: 22px; overflow: hidden;");
for (i = 0; i < searchenginearray.length; i++) {
if (searchenginearray[i][4] == 1) {
linkstyle = "text-align: left; white-space: nowrap; text-decoration: none; background: url('" + searchenginearray[i][5] + "') #FFF 1px center no-repeat; margin: 0 3px 3px 3px; padding: 3px 8px 3px 20px; display: block; color: #00c; font-size: 80%; outline: none; -moz-outline-style: none;";
lg[i] = document.createElement("a")
lg[i].setAttribute("href", searchenginearray[i][3].replace('--keywords--', keywords));
lg[i].setAttribute("onClick","window.open(this.href,'newwin'); return false;");
lg[i].setAttribute("style", linkstyle);
addtext(lg[i], searchenginearray[i][0]);
b.appendChild(lg[i]);
}
}
document.body.appendChild(b);
return true;
}
}
function go() {
make_boxes();
}
function addtext(obj, text) {
var content = document.createTextNode(text);
obj.appendChild(content)
}
function addEvent(objObject, strEventName, fnHandler) {
// DOM-compliant way to add an event listener
if (objObject.addEventListener)
objObject.addEventListener(strEventName, fnHandler, false);
// IE/windows way to add an event listener
else if (objObject.attachEvent)
objObject.attachEvent("on" + strEventName, fnHandler);
}
window.addEventListener("load", go(), false);
})();
