With sufficient programming experience, one can create CGI applications to implement complex interactive systems based on HTML. Fortunately, those with such expertise are often excited enough about their work to want to share it (freely!) with others. The result is the existence of many sites providing pre-packaged systems of CGI programs that can be installed on a web server and used by web page authors who might not have quite enough programming experience to construct the CGI programs themselves. A visit to to Yahoo's collection of CGI related sites will provide plenty of examples of such scripts.
For the first part of this lab, we want you to use one of the freely available CGI scripts. We have installed one such script on the Computer Science department's web server (www.cs.williams.edu) so that you can include references to it in your web pages. The CGI application we have installed does not require you to add any forms to your pages. Instead, you will simply add a URL that references a CGI program as the source of an IMG tag in some of your pages.
Normally, the form that references a CGI script provides information that the script can process. It might seem that invoking a script without using a form would mean that the CGI program would have no information to work with. The truth, however, is that whether a form is used or not, when a CGI script is invoked by a web server, the CGI script is given a fair amount of information about the client that referenced it. This information includes the client's IP address and domain name and the page from which the URL was extracted. When invoked, the CGI script we have installed records this information so that it can later give you statistical reports on the usage of your page. Every time someone visits a page to which you have added a reference to the CGI script, that visit will be recorded. Later, you can find out who visited your page and when.
The package we want you to use is named I-SPI (Internet Statistical Package). It is really quite easy to use. There are three scripts that you will use:
This script expects one key-value pair to be supplied when it is invoked. Because many of you will be using I-SPI at the same time, it needs some information that will allow it to record references to your pages separately from those to other student's. Accordingly, the key-value pair it expects is of the form:
where you should replace "cs-bull-login-id" with your actual account login name. This key-value pair must be attached to the end of the URL used and separated from the rest of the URL with a question mark. For example, for my own pages I would use:name=cs-bull-login-id
http://www.cs.williams.edu/cgi-bin/I-SPI/hit-spi2.cgi?name=tom
You should include an image tag referencing such a URL on every page you would like I-SPI to monitor.
It also expects you to include key-value pair providing your CS bull login account identifier.
The author of I-SPI suggests that the image produced by referencing this script be used as a link to the script used to view the information I-SPI has collected (which is described next). We suggest you include such a link on at least (and probably exactly) one of your pages.
It also expects you to include a key-value pair providing your CS login account identifier.
You should place a link to this script on your CS 105 labs page so that we can try it to make sure everything is working correctly.
So, add IMG tags referencing the "hit-spi2" or "hit-spi" CGI scripts to several of your existing HTML pages. Then, add a link to the "index.cgi" script to your CS 105 labs page. Next, visit a few of your pages and/or ask the student sitting next to you to visit some of your pages. Then, click on the link associated with the "index.cgi" script and see what kind of information has been collected. Take a look again in a few weeks and you should be able to see when the graders hit town.
I should warn you that I will have to remove I-SPI from our server at some point in the future (once the files recording visits to your pages get too large). I will try to do this in a way that will minimize the impact on your pages.