-##############################################################################
-#
-# Running as a CGI
-#
-##############################################################################
-
-my $body_tag = "<BODY BGCOLOR=\"#000000\" TEXT=\"#DDFFDD\"\n" .
- " LINK=\"#00EEEE\" VLINK=\"#EEEE00\" ALINK=\"#FF0000\">\n";
-
-my $html_document =
- ("" .
- "<HTML>\n" .
- "<HEAD>\n" .
- " <TITLE>WebCollage</TITLE>\n" .
- "\n" .
- "</HEAD>\n" .
- $body_tag .
- "\n" .
- "<CENTER><FONT SIZE=1><BR></FONT>" .
- "<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=720>\n" .
- " <TR>\n" .
- " <TD ALIGN=CENTER VALIGN=TOP NOWRAP>\n" .
- " <FONT SIZE=\"+3\"><B>WebCollage: </B></FONT>\n" .
- " <FONT SIZE=\"-1\"><BR><B>by\n" .
- " <A HREF=\"http://www.jwz.org/\">Jamie Zawinski</A></B>\n" .
- " </TD>\n" .
- " <TD ALIGN=LEFT VALIGN=TOP>\n" .
- "\n" .
- " <P><FONT SIZE=\"+3\"><B>Exterminate All Rational Thought.\n" .
- " </B></FONT>\n" .
- " <BR>This program creates collages out of random images\n" .
- " found on the Web.\n" .
- " <P>More images are being added to the\n" .
- " collage now: please wait for the image below to load.\n" .
- " This will take a minute or two, since it has to contact\n" .
- " other web sites to retrieve the images before it can construct\n" .
- " the collage. Once the image below is loaded, you can reload\n" .
- " this page to do it again.\n" .
- " <P>If you enjoy this, you might also enjoy\n" .
- " <A HREF=\"http://www.jwz.org/dadadodo/\">DadaDodo</A>.\n" .
- " WebCollage also works as a screen saver, for those of you\n" .
- " using Unix: it is included with the\n" .
- " <A HREF=\"http://www.jwz.org/xscreensaver/\">XScreenSaver</A>\n" .
- " package.<P>\n" .
- " </TD>\n" .
- " </TR>\n" .
- " <TR>\n" .
- " <TD COLSPAN=2 VALIGN=TOP ALIGN=CENTER><TABLE \n" .
- " BORDER=2 WIDTH=%%WIDTH%% HEIGHT=%%HEIGHT%% \n" .
- " CELLPADDING=0 CELLSPACING=0>\n" .
- " <TR><TD BGCOLOR=\"#C0C0C0\">\n" .
- " %%MAP%%\n" .
- " <A NAME=\"#image\">\n" .
- " <IMG SRC=\"%%IMAGE%%\" BORDER=0 \n" .
- " WIDTH=%%WIDTH%% HEIGHT=%%HEIGHT%% \n" .
- " USEMAP=\"#collage\"></A></TD></TR>\n" .
- " </TABLE></TD>\n" .
- " </TR>\n" .
- "</TABLE>\n" .
- "<P>\n" .
- "</CENTER>\n");
-
-
-my @time_fmt_days = ("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat");
-my @time_fmt_months = ("Jan", "Feb", "Mar", "Apr", "May", "Jun",
- "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
-
-# Converts a time_t to a string acceptable to HTTP.
-#
-sub format_http_time {
- my ($time) = @_;
- my @t = gmtime($time);
- my ($sec, $min, $hour, $mday, $mon, $year, $wday) = @t;
- $year += 1900;
- $wday = $time_fmt_days[$wday];
- $mon = $time_fmt_months[$mon];
- return sprintf("%s, %02d %s %d %02d:%02d:%02d GMT",
- $wday, $mday, $mon, $year, $hour, $min, $sec);
-}
-
-