Assignment 2: CGI

[1] Description: Search engine is an indispensable tool for people to do research on the Internet. One problem with the search engines is the large number of "hits." This assignment is an attempt to improve the result of a search engine.

Step 1: Write a perl CGI program to contact a search engine (such as google). Your program will supply the keyword/phrase to the search engine. The search engine will return you with results (may be divided up into multiple pages). The engine normally rank the result in some ways.

Step 2: Your program then collects the top X hits from the search result. The parameter X is given by the user (See Step 3). Your should also design some operations for the user of the system to perform "set" operations on the result. The "result" is a set of URLs.

Step 3: Write a set of web pages (may be generated by the CGI) as user interface to the CGI. Your web page should collect at least the following information: keyword, number of top hits collected, name of the search result. Also provide ways to (1) view the result, (2) download the result, and (3) manipulate the result.

Given two results, we would like to perform the following operations on them. (1) Intersection, (2) Union, (3) Core, and (4) cover. The core of a ressult set S is a smallest subset T such that every URL in S is reachable from a URL in T. The cover of a set S is the smallest super set T such that includes all URLs in the pages in S. (Sets does not have duplicates.)

[2] Input: None. Get them from a search engine.

[3] Output: None.

[4] Keywords: Perl, CGI, CGI.PM, Sockets, Client-Server, HTML, forms, HTTP, search engine.

[5] Due Date: Monday, October 16, 2002.