|
Richard Forster explains how to widen your search capabilities — and this one is
not for beginners |
For some time the Firefox Web browser has featured a "search bar", which usually
defaults to
using Google. Enter some text into the search bar and Google will seek matches
for it (see Figure 1).
|

Figure 1. The Firefox search bar. |
The search bar has a drop-down list, with other selectable search engines (see
Figure 2).
|

Figure 2. Firefox - Choosing a search engine |
For a bit of retail therapy choose to shop at eBay (see Figure 3).
Firefox 2 introduces new features. Developers can define a Web site as being
"open search compatible" which means that it can quickly be registered in the
search engine list
whenever the site is browsed. The example below shows how this can be done with
the Wikipedia English site (see Figure 4).
|

Figure 3. Searching eBay |

Figure 4. Adding a new search engine |
A very good tool to add to the search bar in this way is `MyCroft'
http://mycroft.mozdev.org/ MyCroft discovers other search compatible sites. It presents a
list of candidates, any of which can be chosen by clicking on the associated
link. Here is an example of choosing a thesaurus using Mycroft, once it has been
added to the search bar (See Figure 5).
In fact with a little bit of XML it is possible to define a search bar entry for
any publicly accessible Web site — Melbourne PC User Group for instance. Here is
an example of searching for `mornington' on the Melb PC site once a suitable
search bar entry had been added. See Figure 6. To find out how this was done see
the Melbourne PC Plugin sample code listed below.
|

Figure 5. The Mycroft search engine |

Figure 6. Searching Melbourne PC User Group |
It has always been possible to add to the Firefox search bar list. What is new
in Firefox 2 is the "Manage Search Engine List" option for adjusting it to
exactly the way you want it. That is why my list probably looks different to
yours — I have adjusted it to suit my needs. See Figure 7.
Why is all this important? Why not just use Google to search everything — isn't
that good enough? The answer to the second question supplies the one for the
first. Searching everything can be a problem. What if you are only interested in
items for sale? The example of restricting a search to eBay for this purpose has
already been presented. To take another situation, what if you need images, but
only from the public domain so that you don't have to worry about negotiating
copyright? A site such as Wikimedia Commons
http://commons.wikimedia.org is
restricted to public domain items, so that is a good place to look. You can add Wikimedia Commons to the search bar list in the manner described above then
quickly choose from it whenever required, and be confident that you won't be
creating copyright headaches. See Figure 8.
|

Figure 7. Managing the search engine list. |

Figure 8. Choosing an open source image |
The World Wide Web is a sea of information and we need all the help we can get
to navigate its shoals and reefs. Search engines are a primary tool for this
task, and the improvements to the Firefox search bar are a valuable contribution
to making them even more useful.
About the Author
Richard Forster, a long time Melb PC member is a project officer at Swinburne
University (TAFE Division)
Search Plugin For Firefox 2 (should also work with IE 7)
Example
*
Create MelbPC.xml
This plugin is for the Melbourne PC User Group. Note the following:
* the URL of the icon to use on line 16
* the URL of the search engine to use (in this case Google) on line 17. The
parameters for the search engine then follow.
The critical one is the last (line 23): sitesearch is set to melbpc.org.au.
1. <?xml version="1.0" encoding="UTF-8"?>
2.
3. <!-
4. Document : searchplugin.xml
5. Created on : 2 February 2007, 08:10
6. Author : RForster
7. Description :
8. Open Search plugin for Melbourne PC User Group
9. ->
10. <OpenSearchDescription
xmlns="http://a9.com/spec/opensearch/1.1/"11.xmlns:moz="http://www.mozilla.org/2006/browser/search/">
12. <ShortName>MelbournePC_User</ShortName>
13. <Description>MelbournePC User Group Site</Description>
14. <InputEncoding>UTF-8</InputEncoding>
15. <Image height="16" width="16"
type="image/x-icon">http://cit3.1d1.swin.edu.au/-richf/melbpc.ico</Image>
16. <Url type="text/html" method="GET" template="http://www.google.com/search">
17. <Param name="ie" value="UTF-8"/>
18. <Param name="oe" value="UTF-8"/>
19. <Param name="q" value="{searchTerms}"/>
20. <Param name="domains" value="melbpc.org.au"/>
21. <Param name="btnG" value="Google+Search"/>
22. <Param name="sitesearch" value="melbpc.org.au"/>
23. </Url>
24. </OpenSearchDescription>
*Create a script to install the plugin (MelbPC.html)
1. <html>
2. <head>
3. <title>Wiki Search Engine</title>
4. </head>
5. <body>
6. <h2>Get the MelbPC search plugin</h2>
7. <a name="Melbpc Search" href="javascript:window.external.AddSearchProvider
8. (http://cit3.1d1.swin.edu.au/-richf/MelbPC.xml');">Click Here</a>
9. </body>
10. </html>
* Upload both files to a server - in this case to http://cit3.1d1.swin.edu.au/-richf?
*
Browse the HTML file and click the link to select and then activate the search
plugin.
*
To install this example, browse to http://cit3.1d1.swin.edu.au/-richf/MelbPC.html?
and click away
For the administrator
To make your site automatically available to be added to the Firefox search bar:
*
Create the searchplugin.xml file as described above
* Add the following line to to the <head> section of your homepage (possibly
index.html).
<link rel="search" type="application/opensearchdescription+xml" title="WebPet
Wiki"
ref="searchplugin.xml"> Replace `searchplugin.xml' with the name of your
searchplugin file.
You can use the same icon ('favicon') to identify your application in the
location bar and your search plugin.
Here is a sample html head section. Notice
that the '<link rel="shortcut', refers to the same icon as that in in the
searchplugin.html, so it will be used consistently for site searching and
identification.
1. <head>
2. <title>Melbourne PC User Group Home Page</title>
3. <link rel="shortcut icon" href="melbpc.ico" type="image/x-icon" >
4. <link rel="search" type="application/opensearchdescription+xml" title="WebPet
Wiki" href="searchplugin.xml">
5. </head> |
Reprinted from the May 2007 issue of PC Update, the magazine of Melbourne PC
User Group, Australia