9

Code

// ==UserScript==
// @name        StackExchange SymbolHound Search
// @description Uses SymbolHound instead of regular search if query begins with "sh:".
// @version     1.1
// @include     http://stackoverflow.com/*
// @include     http://*.stackoverflow.com/*
// @include     http://serverfault.com/*
// @include     http://*.serverfault.com/*
// @include     http://superuser.com/*
// @include     http://*.superuser.com/*
// @include     http://stackexchange.com/*
// @include     http://*.stackexchange.com/*
// @include     https://stackapps.com/*
// @include     http://*.stackapps.com/*
// @include     http://askubuntu.com/*
// @include     http://*.askubuntu.com/*
// @include     http://answers.onstartups.com/*
// @include     http://*.answers.onstartups.com/*
// ==/UserScript==

document.getElementById("search").addEventListener("submit", function(event){
    var q = document.getElementById("search")["q"].value;
    if (!RegExp("^sh:").test(q))
        return;
    event.preventDefault();
    document.location = "http://symbolhound.com/?q=" +
        encodeURIComponent(q.substr(3)) +
        "&l=&e=&n=&u=" +
        document.domain;    
});

About

Ever wanted to search for && on Stack Overflow but couldn't? SymbolHound makes it possible!

From their website:

SymbolHound is a new search engine that doesn't ignore special characters. This means you can easily search the web for symbols like &, %, and ^, or even less common characters such as ©, ¬, and µ.

See also: SymbolHound: Search Stack Overflow for special characters

With this User Script, you can override the built-in search with SymbolHound's.

Just begin type in your query as usual in the search in the upper right corner, but prefix it with sh:.

Examples:

  • sh:&&
  • sh:php <<<
  • sh:difference between == and ===

License

I hereby release this script in the public domain.

Platform

This user script has been tested in Google Chrome 17.0.963.6 and Mozilla Firefox 8.0 with Greasemonkey 0.9.13.

0

You must log in to answer this question.

Browse other questions tagged .