I built a simple node JS server to use as my default search engine. What you describe could be a 2-line change to my code.
My motivation was using Google "I'm Feeling Lucky" without JS. The node app detects the "!lucky" bang, downloads the search results, finds the first link, and redirects to it.
Let me know if it interests you.