Kosala Atapattu

This site is the home page of Kosala Atapattu. You can find verry little info on my self and other interesting links related to various Linux packages. Following links will help you navigate through the pages. Enjoy!!!
Home
Downloads
Taprobane Live CD
FireFox Plug-in
FireFox and Mycroft-Last Updated-November 19,2005

What is Mycroft?


Mycroft is a plugable search mechanism based on Sherlock, from apple computer. Well if that does not give you an insight to the question, this tecniqe involves two file. One is a .src file to, to specify the search format, other file is the image (either, png, gif or jpeg).
For the full story you can go through wikipedia article.

How search works?


Search is defined by an .src file. This file contain certain tags (kind of a markup language), which will define which get variables are required by the search engine. There is a way to POST as well which I did not try extensively.

  • Search Tag
    Serch tag will define the search engine information, version of plug-in, URI to search, form name of the search text box and etc. Full listing with tutorails published on Mozilla Site

  • Browser Tag
    Where to find updates on this link, if there will be a new .src file and image file.


  • Where to start?


    Best place to start is the search engine. First find out how the search send it\\\'s query string while searching. (I don\'t intend to explain on query strings in this section but you can refer to WikiPedia for more information.)

    For example if you take Google, query string is prety much straight forward, if you search something in google you can see what is getting submited in the page. Then it is easily extratable to a mycroft file. Most of the search engines use GET method to post data, making it easy to extract information by user applications.

    Problem with Lurker
    Unfortunately lurker does not display the submitted information, since upon the query we make it redirects the page to anothe location, making it is almost impossible view the query string.

    Workaround?
    There is ancient UNIX command which served the society for many years called netcat (or nc for short) which saved the day. On Linux nc can listen to any network port for UDP/TCP connections.

    # nc -l -p 82

    Above command will start listning on port 82 from the localhost. now simply save your search page on your machine and change the action argument in <form> tag to http://localhost:82 ; save and submit the page after opening. This will dump all the information requested from the search engine.

    Other method is to go throgh all the hidden input forms in the page and reconstruct the query string.

    Reconstructing Query String
    Within the search tag you can specify all the required arguments and values. Following are some sample tags.


    <input name=sourceid value=firefox-searchbar>
    <input name=date value=what_ever>
    <input name=query user>


    There is one input tag that is special, that is the one which relates to your query text field. This name can vary from one SE to another, for example Google use q where most of the others (including lurker) use query.

    Staying upto date
    Anothe aspect of search plugin is to keep up-to-date, what if google change there query format from tomoro, do we have to install a new browser version?...not exactly. Wecan simply specify where to look for new formats and how often. To specify that we can use browser tag.

    Interpret Results
    Hmm....I don\'t know how to use this...:-). Pretty useless with Lurker
    I guess.

    Where to find all the plugins?


    Firefox store all the files under searchplugins folder in application path. You can download LK LUG searchable plug-in from this link.