Skip to content

Instantly share code, notes, and snippets.

@avivo
Created April 18, 2011 16:23
Show Gist options
  • Save avivo/925648 to your computer and use it in GitHub Desktop.
Save avivo/925648 to your computer and use it in GitHub Desktop.
A bookmarklet that searches greplin with the current page's search terms and displays the results at the top of the page.
javascript:
/* Usage:
Copy the contents of this file and paste into the url of a new bookmark to make the bookmarklet.
Click the bookmarklet after searching on a site like google to search greplin with the current search terms - the result will show up in a frame at the top of the page.
This is intended to work with google (but not google instant), and will also work with any site with url's of the same form.
This was a quick hack (tested in chrome 10).
*/
(function(){
var search_terms = document.URL.match(/q=[^&]*/)[0];
var elem = document.createElement("iframe");
elem.src = 'https://www.greplin.com/#' + search_terms;
document.body.insertBefore(elem, document.body.childNodes[0]);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment