// ==UserScript== // @name Google Reader Custom Search // @namespace http://googlesystem.blogspot.com // @description Search your Google Reader feeds using Google Co-op // @include http://google.com/reader/* // @include http://*.google.com/reader/* // ==/UserScript== // Go to your custom search engine at google.com/coop/cse . Do a search for test. // You will get a URL like: // http://www.google.com/custom?cx=003884673279755833555%3A_8kirrqzcjs&q=test&sa=Search&cof=CX%3AGoogle%2520Reader%2520Search%3BFORID%3A1 // Remove this from the URL: "&q=test" and copy the result here, where it says: "REPLACE-THIS" var SearchURL="REPLACE-THIS"; if (document.getElementById('logo')!=null && document.location.search.indexOf("gmail-embed") == -1) addSearchBox(); function addSearchBox(){ var mybody = document.getElementsByTagName("body")[0]; var globalInfo = document.getElementById("global-info"); var buttonContainer = document.createElement("div"); buttonContainer.setAttribute('style','position: absolute;top: 17px; left: 158px;margin: 0;'); var searchInput = document.createElement("input"); searchInput.value = ""; searchInput.setAttribute('id','searchInput'); searchInput.addEventListener('keypress',onSearchKeypress,false); buttonContainer.appendChild(searchInput); buttonContainer.className = "buttonContainer"; var searchFeed = document.createElement("button"); searchFeed.setAttribute('style','margin-left: 5px;'); searchFeed.appendChild(document.createTextNode("Search")); searchFeed.addEventListener("click", onSearch, false); buttonContainer.appendChild(searchFeed); mybody.insertBefore(buttonContainer,globalInfo); } function onSearchKeypress(event){ if (event.keyCode==13){ onSearch(); } } function onSearch(event){ var query=document.getElementById('searchInput').value; window.open(SearchURL+"&q="+query, "_blank"); }