Mega-ZBlog

You are here.

Mega-ZBlog header image

OpenSearch Google in Windows 7

January 14th, 2009 · 7 Comments · Programming, Website, Windows

I just hacked together a neat little PHP script that allows me to Google search right from Windows Explorer in Windows 7.  I was inspired by this guy.  I don’t wait around for Google, I’ll do it myself. :D

Windows 7 introduces a new feature which allows you to add search engines right to Windows Explorer.  It’s not as convenient as in a web browser (the search engine is represented by a file somewhere on your computer that you download) but it works.

It uses the standard OpenSearch spec (with their own Microsoft twist, of course!) to query search engines which already conform to this standard.  Basically you can pass a script your search terms and get them back in an RSS or Atom feed which Explorer or any OpenSearch compatible client can parse and display how they like.

Google doesn’t offer any such feed.  So I made a PHP script to parse the HTML output Google feeds web browsers (using this library) and spit out an OpenSearch RSS feed.  Works pretty good.

Had a few annoying problems along the way… a big one was I couldn’t always get Explorer to parse it and it doesn’t tell you why.  For some reason I didn’t think to try to view the feed in Internet Explorer to get a more detailed error report.  Turns out Google pages use a different encoding than what I was marking the XML file with, and that was causing feeds with smart quotes to annoy Explorer.

Anyways it’s working now.  You can try it out with this.  Download and double click to have Explorer open a search window.  This DOES proxy the results through my server so don’t use that if you plan on using it regularly… here’s the source code.  Go put it on your own server.  Just remember to change the urls in all the files to point to your server instead of mine.

There’s an extra file, opendescription.xml.  AFAIK it’s not NEEDED for Explorer but it’s part of the OpenSearch spec so there it is.  This should be compliant with the spec, so not just Explorer can use it.

Tags: ·······

7 responses so far ↓

  • 1 alwinv // Feb 13, 2009 at 1:11 pm

    You should post a .osdx file instead of the .searchconnector-ms file. Opening the .osdx installs the other for you automatically and can be used by other OpenSearch compatible software. Here’s the equivalent XML for your feed:

    Google
    OpenSearch Google via Windows 7 Search.

  • 2 someone // Apr 3, 2009 at 10:53 pm

    Maybe this’ll help?: http://feedmysearch.com/

  • 3 Conociendo los conectores de búsqueda de Windows 7 – Blog de Raúl Serrano // Dec 26, 2009 at 3:27 pm

    […] que puede conllevar. En el caso del conector para Google desarrollado por Dan Bugglin, podemos acceder a su código fuente y montarlo en nuestro propio […]

  • 4 Federated Search Connectors For Windows 7 // Nov 1, 2010 at 3:42 pm

    […] Google Search Connector For Windows 7 – Thanks […]

  • 5 Search Web From Windows 7 Explorer by Federated Search Connector // Nov 4, 2010 at 12:16 pm

    […] Connector 9. YouTube Search Connector 10. Flickr Search Connector 11. MSN Search Connector 12. Google Search connector for Windows 7 13. Bing search […]

  • 6 Hardik // Sep 22, 2012 at 2:49 am

    Where’s the link to the .osdx file ?

  • 7 Search Web From Windows 7 Explorer by Federated Search Connector // Feb 21, 2014 at 2:03 am

    […] Connector 9. YouTube Search Connector 10. Flickr Search Connector 11. MSN Search Connector 12. Google Search connector for Windows 7 13. Bing search […]

Leave a Comment