Assignment 2 -- Plotting Bid History Graphs for eBay Auctions

You may discuss this assignment with classmates, but all your code and written work must be your own. Reference all sources. Please hand in hard copy.


Description -

When an auction on eBay is closed, eBay will reveal almost all information about its bid history, including bidder IDs, amount of each bid1 and dates of bids. It would be of great help for the study of real-world auction behavior, if we can present that piece of information in some detailed and intuitive way. And that is what assignment 2 is about -- plotting bid history graphs for closed auctions on eBay.  [Since this assignment was first written eBay anonymizes the bidders when the current price exceeds $200. Thus the real IDs of the bidders become hidden at that point, but repeated bids by the same bidder are assigned the same tags by eBay. This shouldn't affect your graphs. -- ken]

Web pages containing the needed information have URLs of the form http://cgi.ebay.com/ws/eBayISAPI.dll?MfcISAPICommand=ViewBids&item=nnnnnnnnn. So again, you only need an item's ID # to be able to download the corresponding page for it and extract the needed information using the same technique as in Assignment 1. 

Here is an example bid history page, and the graph we want to plot for it looks like this . Those small crosses on the graph denote all the bids, using date of bid as X coordinate and bid amount as Y coordinate. The dotted curve shows the evolution of "current price", which is basically the price given by the current second highest bidder. When there is only one bidder, "current price" is, by definition, the opening bid, which is shown on eBay's web pages as "Starting Price xxx". 

The previous graph covers the whole history of an auction, thus in some sense gives us the "global" view of the auction. However, bids of an auction tend to cluster around some very short periods of time inside an auction. Details of these intensive periods are most interesting to our study while most likely to be missed out in a "global" graph covering a period of several days. So it would be useful to plot separate graphs providing "zoomed-in" "local" views of these periods. Here is the "local" graph for hour 110-115 of the example auction.

1 Except for the highest bid, which is replaced with the second highest bid plus an increment.

Requirements -

The program should, at the minimum,

At the minimum, please hand in hard copies of a few examples (two printed graphs for each example), a very brief description of the method you used, and the printed code. You may be called on to supply working code in digital form. Again, the program and methodology is up to you, but here is some help for those of you who want to plot graphs using gnuplot.

Hints for gnuplot - 

Gnuplot is a free, command-driven, interactive, function and data plotting program available on most Unix machines. A quite complete description of Gnuplot can be found at http://www.duke.edu/~hpgavin/gnuplot.html or http://www.sunsite.ualberta.ca/Documentation/Gnu/gnuplot-3.7.1/html_chapter/gnuplot_toc.html.

The way we want to use gnuplot for our assignment is to run gnuplot with a command file. So on some Unix console, you will type in "gnuplot <command file name>" to plot the graphs. The best way to learn something is to learn it by example. Here is the example command file I used to generate the above two graphs (for the "local" graph, uncomment the "set xrange [110:115]" line by deleting the leading '#'). Most of the commands in the command file are quite self-explaining and some important points are as follows:

1. Gnuplot will try to generate a postscript file for the graph, whose name is specified in the "set output ..." line; [The program "ps2pdf" will convert to pdf. -- ken]

2. The plot command is where the graph gets plotted. In the example command file, we used two data files: data1 and data2, for crosses and the dotted curve respectively. 

According to the requirements of this assignment, both command files and data files for gnuplot should be generated by your program.

Hints for string-to-number transformation for date-of-bid information - 

eBay gives date-of-bid information as strings like "Jan-10-04 18:59:55 PST" while for our purpose we would like to have that information represented as, say,  number of seconds passed since some pre-specified point in time. It would be quite tedious to do the string-to-number transformation by ourselves. DateParser.java demonstrates how to use existing Java classes to transform strings like "Jan 01, 2004 12:33:33 AM GMT" into numbers of seconds passed since Jan 01, 1970 00:00:00 AM GMT. Try to make use of it.


Edited by Ken Steiglitz, Thu Feb 14 04:53:18 EST 2008