Welcome to MSDN Blogs Sign in | Join | Help

Blog Customizations, Part 4: OpenSearch Discovery

I'm a big fan of extensibility, which is why I was excited to see in a recent blog post on the IE Blog about OpenSearch discovery using <link/> elements. OpenSearch is a collection of XML schemas and extensions to RSS that enables clients like Internet Explorer to interact with search results in order to discover, query, and parse search results in a standard way.

Web sites can add new search providers using window.external.AddSearchProvider in Internet Explorer 7 Beta 2 Preview. I'm not naive enough to think anyone would want a permanent provider listing for my blog, but I have again customized this blog to add two <link/> elements that allow IE7 Beta 2 Preview to use the same search box to search both my and MSDN's blog content. Below is the result of this new customization.

Since I have limited ability to customize my blog I have had to take advantage of the fact that Internet Explorer currently accepts <link/> tags in the body. The elements are simply the following:

<link rel="search" title="Heath Stewart's Blog" href="http://hstewart.members.winisp.net/search/heaths.xml" type="application/opensearchdescription+xml" />
<
link rel="search" title="MSDN Blogs" href="http://hstewart.members.winisp.net/search/msdn.xml" type="application/opensearchdescription+xml" />

OpenSearch Descriptions are quite simple. The content of the first URL above follows:

<?xml version="1.0"?>
<
OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
    <
ShortName>Heath Stewart</ShortName>
    <
Description>Search Heath Stewart's Blog</Description>
    <
Url type="text/html" template="http://blogs.msdn.com/heaths/search.aspx?q={searchTerms}&amp;p={startPage}" />
    <LongName>Heath Stewart's Blog</LongName>
</
OpenSearchDescription>

Consider adding OpenSearch to your site. See http://opensearch.a9.com/ for more information.

Published Wednesday, February 08, 2006 4:21 PM by Heath Stewart
Filed under:

Comments

Friday, February 10, 2006 11:03 AM by Michael Fagan

# re: Blog Customizations, Part 4: OpenSearch Discovery

one small quibble: ShortName is limited to 16 characters, you should be using LongName. Otherwise, excellent post.
Friday, February 10, 2006 12:12 PM by Heath Stewart

# re: Blog Customizations, Part 4: OpenSearch Discovery

Michael, thanks for pointing that out. I'll get the post and the OpenSearch descriptions fixed. For folks at home tuning in, see http://opensearch.a9.com/spec/1.1/description/#shortname for what Michael mentioned.

If only I would've had a "not-so-user-friendly-but-geeky" XML schema. I haven't been able to find one on the OpenSearch site. Has anyone seen one? Documenting XML should be through schemas but certainly more user-friendly descriptions like the specification link I posted are genuinely helpful.

That's still no excuse for missing that constraint, though. Thanks, Michael.
Tuesday, February 14, 2006 10:21 AM by Michael Fagan

# re: Blog Customizations, Part 4: OpenSearch Discovery

I'm not aware of any XML schema for OpenSearch yet, but if you created one I'm sure they'd add it to the website.
Tuesday, November 28, 2006 7:59 PM by Aaron's Blog

# Blog Skin Updates

The awesome Health Stewart has graciously let me plagiarise his custom CSS to help me make my blog look

Wednesday, March 07, 2007 1:14 PM by Heath Stewart's Blog

# Better Searching with Live Search and OpenSearch Discovery

Sometime back I updated my blog to take advantage of Internet Explorer 7 by providing an OpenSearch discovery

New Comments to this post are disabled
 
Page view tracker