
Introduction
** Skip intro, just show me the code!! **
If you use Mozilla Firefox to browse website like I do, you will notice a search text box located on the top right of the browser. You can even customize which search engine you want to use from the search text box. By using search engine plugin, you can retrieve information faster and easier. One of the most frequently used search plugin is IMDB plugin. Whenever I want to know the any information on a particular movie, I just type in the movie title on the search box, select IMDB plugin, and hit enter key. The search will direct me to IMDB website and list out the movie detail or list all closest match movies title entered.
Likewise, you can have your own personalized search engine plugin that you may want to share with your readers. It is more efficient and faster for your readers to search for articles on your website by just using this method.
In this post, I will write a short tutorial in creating your own search engine plugin. Don’t worry if you have no prior programming skills. It’s pretty straightforward and can be done in less than 5 minutes.
The Codes
Below is the code snippet for my website search engine plugin. You can copy the code below and paste it in notepad.
** Please note that the code below only supports Firefox 2.0 or above and Internet Explorer 7 (IE7).
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">">
<ShortName>BytesWired</ShortName>
<Url type="text/html" method="GET" template="http://www.byteswired.com">
<Param name="s" value="{searchTerms}"/>
</Url>
</OpenSearchDescription>
What you see above is the simplest form. You need following tags:
- OpenSearchDescription- You must to include
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">.
- ShortName - The name of your search engine which will be display on the search box
- URL - The URL of your website/blog
- Param - The parameter(s) to include while searching on your website/blog.
- {searchTerms} is the keyword referring to the text you entered on the search box.
For instance, my website is running on Wordpress platform. I know the full URL to perform search in my site is
http://www.byteswired.com?s={searchTerms}
where you replace {searchTerms} with any keywords you want to search. So, the param name need to be included is “s” as shown above. You should change the param name according to your website.
Once you are done with it, save the file as <filename>.xml. Replace <filename> with any name you want.
Installing New Search Engine Plugin
- Place the new file under the directory C:\Program Files\Mozilla Firefox\searchplugins\ . Restart your Firefox browser (close all Firefox browser).
- Click on the search engine plugin available and you will see your new search engine plugin is now installed.
Extra
Apart from the tags mentioned above, there are other tags available such as:
- <InputEncoding> - default is UTF-8
- <Developer> - developer name
- <Image> - if you like to include a 16×16 icon beside the search text box
What’s Next
In next article, I will show you how you can do the same on IE 7. Plus, I will also show you how to tweak your registry to allow searching using keyword.
Share This
Try this out and let me know the outcome. If you have problem creating your own personalized search engine plugin, do not hesitate to drop me a line. Will try to help…