Life in Prague

« Can piracy boost IT... | Main | Best Employer in IT... »
Friday Mar 30, 2007

Firefox Search Plugin for blogs.sun.com and www.sun.com

Firefox Search Plugin for blogs.sun.com and www.sun.com

 
Tired of going to blogs.sun.com or sun.com just to start searching these pages?

Every click counts, time is money, so if you use Firefox and you are addicted to Search Bar (like me),  you'll have to have the search engines for blogs.sun.com and www.sun.com. Just add the plugin directly from this page, clicking to the icon in Search Bar, as shown on the picture.

Optionally, you can also download the xml file
and put it into the searchplugins directory in your Firefox installation or profile.

There is also search engine for internal search, that can be useful if you're Sun employee.

How is it done?

It's pretty simple. Firefox  uses Open Search description format, with some additional features. You don't have to bother to read complete specification, the best way is to start with the the article Creating OpenSearch plugins for Firefox.  Everything is in one little XML file:


<OpenSearchDescription
xmlns="http://a9.com/-/spec/opensearch/1.1/"
xmlns:moz="http://www.mozilla.org/2006/browser/search/">
<ShortName>Blogs@Sun</ShortName>
<Description>Sun Microsystems Blogs</Description>
<Image width="16" height="16">
data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%10%00%00%00%10%08%06%
...
</Image>
<InputEncoding>UTF-8</InputEncoding>
<Url type="text/html" method="GET" template="http://onesearch.sun.com/search/blog/index.jsp">
<Param name="qt" value="{searchTerms}"/>
<Param name="col" value="blog"/>
<Param name="charset" value="UTF-8"/>
</Url>
<moz:SearchForm>"http://onesearch.sun.com/search/blog/"</moz:SearchForm>
</OpenSearchDescription>

1. Short Name and Description
Change Short Name and Description as you like.
2. Image (optional)
Image is a little bit tricky, and you can eventually skip this step.
You need to put the image in a binary form to the XML file. Use or download your favorite icon or little png file (16x16 pixels) or create your own and convert it by URI kitchen.
3. URL and Parameters
It's the only critical part. You have to do a little reverse engineering to figure out the parameters and URL for search engine on particular site by looking into html source code, but it's not a big deal, if you're are at least familiar with basics of html editing. There should be something like
<form action = "the_url_to_the_search_method">
and you just need to use that URL for
template="the_url_to_the_search_method"
You can convert   <input> tags easily to <Param>, using name and value.
The only exception is the input tag that provides the search string. Parameter name must correspond with the name of input field, value always equals "{searchTerms}".

4. URL to Search Form (optional)
Replace the URL in <moz:SearchForm> by the URL that points to the Search Home Page and you're done.

5. Deployment & Testing
OK, not yet, as you need to put the XML file in proper directory (searchplugins in Firefox installation or your profile) and test it. If it doesn't show up, after restarting Firefox, check the XML for validity. You can open the XML file in Firefox or NetBeans. Missing closing tag is a typical mistake.

Comments:

Nice! The search team will be releasing OSD files with the next release of Sun's search application, along with browser self-discovery from search.sun.com. We will also be looking into creating a suggestions service to tie into them.

Posted by matthew on March 30, 2007 at 05:44 PM CEST #

That's cool. Suggestions will be excellent. Looking forward to it.

Posted by Pavel Suk on March 30, 2007 at 11:10 PM CEST #

The steps for adding search providers in IE7 is mentioned here - http://www.microsoft.com/windows/ie/searchguide/en-en/default.mspx?dcsref=http://runonce.msn.com/runonce2.aspx#

Posted by manish on April 01, 2007 at 08:07 AM CEST #

Post a Comment:
Comments are closed for this entry.