Adding OpenSearch to your website and getting in the Browser's Search Box July 21, '08 Comments [18] Posted in Musings | Tools | Web Services Sponsored By I was over at http://search.twitter.com earlier today and I noticed the Search Box in Firefox had a blue lit-up dealie: Hm...OK. What's that? I hit another site and didn't see it. Weird. Ok, View-Source then, what drives you little blue thing?<link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="Twitter Search"> Hey, that's not something I've seen before. What's in it...http://search.twitter.com/opensearch.xml...<?xml version="1.0" encoding="UTF-8"?><OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"> <ShortName>Twitter Search</ShortName> <Description>Realtime Twitter Search</Description> <Url type="text/html" method="get" template="http://search.twitter.com/search?q={searchTerms}"/> <Image width="16" height="16">http://search.twitter.com/favicon.png</Image> <InputEncoding>UTF-8</InputEncoding> <SearchForm>http://search.twitter.com/</SearchForm></OpenSearchDescription> Ah! I totally get it. Excellent. I shall make my own immediately! I added this file to my website and added a <link> line as seen in the first example above that pointed to it.<?xml version="1.0" encoding="UTF-8" ?> <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"> <ShortName>Hanselman Search</ShortName> <Description>Search Scott Hanselman's Blog</Description> <Url type="text/html" method="get" template="http://www.hanselman.com/blog/...snip...q={searchTerms}"/> <Image width="16" height="16">http://www.hanselman.com/blog/favicon.ico</Image> <InputEncoding>UTF-8</InputEncoding> <SearchForm>http://www.hanselman.com/</SearchForm></OpenSearchDescription> Bam. I wonder if it works in IE7? Pow! I wonder if Live.com supports it? Eek! FAIL. I'll mention that to someone at Live.com OpenSearch is a really easy feature that you can add to your website in literally minutes. Seconds if you type fast. Check me out noticing this only three years late. :) Give it a try! IMPORTANT NOTES: Make sure you include the first line of the XML file (the XML declaration) or IE will ignore it and nothing will happen when you add it. Also, make sure you include the default XML namespace or Firefox will give you an error: "Firefox could not download the search plugin" Technorati Tags: OpenSearch,Blog « Learning WPF with BabySmash - Making a T... | Blog Home | The Weekly Source Code 30 - Spark and NH... » About Scott Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author. About Newsletter Sponsored By Hosting By