SearchPlus


Introduction


SearchPlus provides a search box in the toolbar of Oregano2. It builds on the Google search boxes already available, but provides some extra facilities.

If you type a word or phrase into the box and press return, Google will be queried with your phrase (as with the alternative search boxes). But you can also specify other types of search by prefixing your query with a couple of mnemonic characters. For example:

i:uk flag

will return a page of images of the UK flag, and

f:matrix

will query IMDb about the Matrix films.

The search prefixes provided are:

g:Google UK (used as the default if no prefix is given)
i:Image search (Google UK)
n:News search (Google UK)
y:Yahoo! search!
j:Ask Jeeves search
l:Lycos search
a:Acorn newsgroup search (Google Groups)
d:Drobe archive search (using Google)
w:Word definition (dictionary.com)
t:Thesaurus (dictionary.com)
f:Films (IMDb)
m:MP3 (AltaVista media)
/.Slashdot
G:The Guardian newspaper
am:Amazon (UK) -- thanks to Sendu Bala for this
z:Amazon (UK)
dp:Dogpile (search engine aggregator)
di:Dogpile Images
da:Dogpile Audio
h:Just for fun, the House price search. Type h: and your postcode :-)

SearchPlus can easily be customised. You can add as many new engines as you like, or change the existing ones.

Installing


Before changing Oregano2, please make a back-up copy and store it safely.

Installation instructions are provided for the Default skin and the elegant Lanai skin, created by Sendu Bala. Installing on other skins isn't too difficult - just edit the file:

!Oregano2.Resources.Skins.<skin-name>.Panes.Tool/html

in an appropriate fashion, using the instructions below as a guide.

To find out which skin you're using, click on Choices... from Oregano2's iconbar menu, and select the "Browser identity" tab (a hand holding a book, for some reason). The skin is the first option.

Default skin

Quit Oregano2, unzip the download, and drop the enclosed !Oregano2 directory on to the program on your hard disc. Restart O2, and you should see a search box with "Search+" in it to the right of the address bar.

Lanai skin

Note that recent versions of this excellent skin already have Search+ installed. If the search box contains "Search+" you already have it.

But if you're using an older version you'll need to do a bit of editing, which you'll be used to if you've used the excellent drop-down menus that Sendu Bala implemented. But first, take a back-up!

Step by step:

Customising


Remember: always take a back-up before modifying Oregano2!

SearchPlus can easily be customised. You can add as many new engines as you like, or change the existing ones. The mnemonics are case-sensitive, and can be anything you like (though it's best to choose some sequence of characters that you're unlikely to search for, of course). They don't have to be two characters, or include a colon.

Editing an entry


The simplest way to edit the current skin is to click in O2's address bar, and press F8 - the file will load into your current text editor ready to edit. If you're using StrongED, ignore the spurious error message. Make your changes, save the file, and the next time you open a new Oregano2 window your changes will be in effect.

Scroll down to the SearchMore section (about halfway through). The important bit starts:

sdefs = new Array(

and consists of a series of lines starting new Array. Each line defines a search engine, with the mnemonic coming first, then the search prefix, and finally the search suffix. Here's an example:

new Array('g:',  'http://www.google.co.uk/search?q=', ''),

This is the first entry, which is used as the default if no mnemonic is specified.

Each part is a string enclosed in single quotes. In this case there's no suffix, so the third string is empty. Note particularly the final comma. All entries except the last must have a comma. Be careful - the syntax must be exactly right, or the script won't work (no helpful error messages, I'm afraid).

For example, if you'd prefer m: to search for movies (rather than f: for films), change this line:

new Array('f:',  'http://www.imdb.com/find?q=', ';tt=on;nm=on;mx=20'),

to

new Array('m:',  'http://www.imdb.com/find?q=', ';tt=on;nm=on;mx=20'),

But remember to also change the current definition of m:, perhaps to this:

new Array('3:',  'http://www.altavista.com/audio/results?q=', '&maf=mp3&mad=all'),

so that 3: searches for MP3s.

Adding a new engine


To add a new search engine, you need to find out how it conducts its searches. Go to the site, enter something in the site's search box, trigger the search, and look at the address bar at the top of the window. Here's what you get for a search on "oregano2" with Teoma, a search engine owned and used by Ask Jeeves:

http://s.teoma.com/search?q=oregano2&qcat=1&qsrc=0

Check that your search term appears somewhere. Some sites don't work like this, in which case you may not be able to use the site's search facility with SearchPlus. You also might have problems with sites requiring log-ins, or using sessions. eBay appears to be among these - I imagine they want to restrict automated access to their search facilities (for fairly obvious reasons).

This one's fine, though. To add Teoma to your search options, create a new entry in the Tools file and blank out the fields:

new Array('',  '', ''),

Decide on a mnemonic, ensuring it's not already used. t: is already taken, so we'll use te:

new Array('te:',  '', ''),

Take the bit before your search term and put it in the search prefix section:

new Array('te:',  'http://s.teoma.com/search?q=', ''),

And finally take the bit after your search term (if present) and put it in the search suffix:

new Array('te:',  'http://s.teoma.com/search?q=', '&qcat=1&qsrc=0'),

You may find that the search suffix is not actually needed - experiment if you're not sure.

Envoi


If you have any problems, don't hesitate to email me.

Any future releases can be found at http://www.roast.iconbar.com/misc/oregano2/

-- Chris Terran, Sun, Apr 3, 2005