Blog Customizations, Part 4: OpenSearch Discovery

Heath Stewart

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.

0 comments

Discussion is closed.

Feedback usabilla icon