IBM Research
 

Yahoo Subjects

Try It Out

If you want to check out the Yahoo Subjects plugin, do the following:

  1. How to setup the plugin:
    • Start WBI and setup your browser to use WBI as a proxy.
    • Register the Yahoo Subjects plugin on the WBI console by typing (on one line):
         register com/ibm/wbi/examples
               /YahooCategories/YahooCategories.reg
    • Check to see whether the plugin is registered and enabled. Go to the WBI Setup page. The YahooCategories plugin should be listed in the table with a checkmark next to its name. If the plugin is not listed, try registering it again. If the checkmark is not there, click on the box to the left of the plugin name.
    • Open another browser window. Use that window to try out the plugin, and use this window to display the documentation. (To open another window using Microsoft Internet Explorer, go to File -> New -> Window. To open a window using Netscape Navigator, go to File -> New -> Navigator Window.)
  2. How to use the plugin:


What It Does

When browsing the web, you often want to go back to a specific page but cannot remember the exact URL. Sometimes you know that it was two days ago or that it was a Yahoo category you want to get back to. Wouldn't it be nice to have a tool that could list the relevant places you've visited (e.g., Yahoo categories)?

The Yahoo Subjects plugin is designed to keep track of the Yahoo categories a user visits over time. The plugin monitors the user while he or she is browsing the web. Whenever the user visits a Yahoo subject (e.g., Computers & Internet), the plugin keeps track of this category by storing the URL of the Yahoo subject in a database. The entries in this database can later be viewed on request.


How It Works

Architecture

The Yahoo Subjects plugin is a combination of Megs that can monitor web content and produce HTML pages using a Monitor and a Generator. The Monitor recognizes when the user visits a Yahoo category and stores this event in a database. The generator is used to access the stored information and produce a list of previously visited Yahoo categories. This list is a HTML resource that can be displayed by the browser.

MEG Model

The figure illustrates the architecture of the Yahoo Subjects plugin. The Monitor will log outgoing requests for Yahoo subjects in the database to maintain a list of subjects that the user has visited previously. The Generator accesses the database and creates the list of visted subjects that can then be displayed by the browser.

The Yahoo Category Tracker Architecture

Implementation Details

  • The Yahoo Category Monitor is used to recognize when a user visits a Yahoo category and if so, store the category in the database. Using the Meg programming model, we can easily implement such a monitor by subclassing the generic class HttpMonitor. The class YCategoryMonitor monitors Yahoo categories. This monitor is setup such that it is invoked by WBI when the user visits the Yahoo directory. The rule to configure the monitor is

    host dir.yahoo.com

    When the user visits a Yahoo category the monitor gets invoked because the part of the URL that specifies the host is always dir.yahoo.com. The Yahoo category monitor is invoked by calling its void handleRequest(RequestEvent) method. This method extracts the name of the Yahoo category and stores it in the database.

  • The Yahoo Category Generator is used to provide the user with the list of Yahoo categories he previously visited. This generator is implemented by subclassing a generic Meg (class HttpGenerator). The Yahoo Category generator produces the list of previously visited categories on a user's request for the following URL:

    http://_YahooCategories

    WBI will invoke the yahoo category generator by calling the generator's handleRequest(...) method. Therefore, the rule to configure the generator is: host _YahooCategories. In this handleRequest(...) method, the generator will access the database, read the names of the previously visited Yahoo categories and produce an HTML page. Each entry on this page provides references to the category itself and and all its preceeding categories.

  • Storage and access to the names of the previously visited Yahoo categories is implemented by using the classes Section class.

  • Some key WBI classes that were used:

    Package com.ibm.wbi.protocol.http.beans
    StaticHtmlGenerator Used by YCategoryGenerator in order to send the HTML page that displays the subjects list to the browser.
    Package com.ibm.wbi.protocol.http
    HttpGenerator Extended by YCategoryGenerator.
    HttpMonitor Extended by YCategoryMonitor.
    Package com.ibm.wbi.util
    Section Used by class YCategoryTracker to open, save and close the information about visited Yahoo subjects.


The Source

YCategoryTracker.java
Contains the class definition for the Yahoo category tracker plugin.
YCategoryMonitor.java
Contains the class definition for the Yahoo category monitor.
YCategoryGenerator.java
Contains the class definition for the Yahoo category generator.
YahooCategories.reg
Contains the necessary code to register the plugin with WBI. Registration is done through WBI during runtime.
index.html
This file.
megmodel.gif