#!/usr/bin/perl -wT

use strict;

my $file = "links.txt";
my $other_file = "images.txt";
my $final_file = "text.txt";
my $last_file = "otherimages.txt";
my $buf;
my @linkslist;
my @link;
my $random_link;
my @images;
my @captions;
my @entries;
my @entry;
my @interior;
my $teaser;

open (FH, $file) or die "cannot open $file";
read (FH, $buf, 1024);
@linkslist = split (/\n/,$buf);
@link = $linkslist[int(rand(@linkslist))];

if(defined($link[0])){
  $random_link = "http://" . $link[0];
}
else{
  $random_link = "/images/Pixel_art/";
}
close (FH);

open (FH, $other_file) or die "cannot open $other_file";
read (FH, $buf, 1024);
@entries = split(/#/,$buf);

close (FH);

open (FH, $last_file) or die "cannot open $other_file";
read (FH, $buf, 1024);
@interior = split(/\n/,$buf);

close (FH);

$teaser = $random_link . "11-26_PM_COMPLETE.jpg";

print "Content-type: text/html\n\n";

print <<END_OF_TOP;

<html> 
<head> 
<title>UCSC Engineering Building Gets an 8bit Upgrade</title>
</head>
<style type="text/css">
        body { font-family : "arial";
        background : #005050 ;
        color : white; }
        A:link, A:visited { text-decoration : none }
        A:visited { color : #20A0D0 }
        A:link { color : #20A0D0 }
        A:hover { color : #80E0F0;
	background :  ;}

</style>
<body>
<br><br>
<script type="text/javascript"><!--
google_ad_client = "pub-4938435996847465";
/* 728x90, created 3/27/09 */
google_ad_slot = "8841718818";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<br><br>
<table cellpadding = 4 width =%100 border=0>
<tr><td rowspan=2>
<a href =$teaser>
<img border = 0 src=$teaser width=260>
</a>
</td>
<td valign=top width = 30%>
<font size =+4><b>Super Mario</b></font><br>
<font size =-1>
3x3 Post-it<sup>&reg</sup> on glass<br> 
4 floors x 1 window<br>
E2 Building UCSC
</font>
</td>
<td width=55% align=right>
</td>
</tr>
<tr><td valign=middle>
<font size =-1>
Artist(s) <i>Anonymous</i>
</font>
</td>
<td valign=middle align=left>
My Next Project...<br>
<a href="http://www.virtualshackles.com">
<img src="http://www.virtualshackles.com/image/square.jpg">
<br>
Virtual Shackes
</a>
<br> A Webcomic
</td>
</tr>
</table>
<br><br>
<h3>About the piece</h3>
Super Mario Bros. (Miyamoto, et. al.,1986) was an inspiration to many of 
todays computer engineers.  In celebration of Engineering Week, this 
large format work was created as an homage to the inspirational works of 
these and other great computer engineers and scientists.  
Currently 3/4 of this work is still visible at the E2 building at 
UCSC, it is scheduled to be removed Friday night.
<p>
2/21/05<br>
So we figured if we put this up the day before the week formally known
as National Engineers Week they'd see it as part of the grand
festivities (normally consisting of tables) and not take it down.  Maybe
I'll have more to write about it tomorrow when it is either taken down
or not.
<p>
2/22/05<br>
Well we didn't count on one thing, bean counters are not engineers.  
So even under the protective banner of engineering week, the most holy 
of weeks in the engineering calender, the econ department ripped down 
every post-it<sup>&reg</sup> note on their floor.<br><br>
<img src="http://www.yikes.com/~pengo/images/Pixel_art/thumbnails/j-10-57_Interior3rdFloor.jpg">
<br>Rest in peace Mario...
<p>
2/28/05<br>
Thus ends engineering week.  The school (most of it) was nice enough to 
leave the post-ts up, so I figured we'd take em down.  Well and since 
the econ department liked to take them down so much, I figured we'd add 
in something special for them too.
<br><br>
<center>
<a href="http://www.yikes.com/~pengo/images/Pixel_art/gameover2.jpg">
<img border=0 height=200 src="http://www.yikes.com/~pengo/images/8bit/gameover2_t.jpg">
</a>
&nbsp&nbsp&nbsp&nbsp
&nbsp&nbsp&nbsp&nbsp
&nbsp&nbsp&nbsp&nbsp
<a href="http://www.yikes.com/~pengo/images/Pixel_art/gameoverinside.jpg">
<img border=0 width=200 src="http://www.yikes.com/~pengo/images/8bit/gameoverinside_t.jpg">
</a>
<br><br>
</center>
6/22/05<br>
FHM'd July 2005 issue
<br><br>


<h3>Total Number of Post-its<sup>&reg</sup></h3> ~3800
<h3>Total People</h3> 12
<h3>Total Time</h3> 1.5 hours<br>
<h3>Comments</h3>
Black Post-its<sup>&reg</sup> really do exist!  I so didn't 
believe the person that told the person (who is not me) about 
them when said person was planning this.<br><br>
OfficeMax stickynotes are cheaper but they don't stick! 
Buy Post-it<sup>&reg</sup> brand stickynotes for a good stick everytime!<br>
(please give us money 3M, this was expensive!)
<br><br><br><br>
<h1> Construction </h1>
END_OF_TOP

foreach (@entries)
{
 @entry = split (/&/);
 print "<img src=$random_link".$entry[0]." height=640><br><br>\n";
 print $entry[1] . "<br><br><br><br>\n";
}

$buf = $random_link . "BANDITS.jpg";

print "<h1> Interior Views </h1>";

foreach (@interior)
{
 print "<img src=$random_link".$_." width=640><br>\n";
}

print <<END_OF_THE_LINE;

<br>
<h1> Credits </h1>
<sup>Hosted by:</sup> <a href="http://www.yikes.com">
<img border=0 height=25 src="http://www.yikes.com/images/gleepi.gif">
</a><br>
Inspiration: <a href="http://hacks.mit.edu/Hacks/by_year/2003/vidwall_postits/">Post-it<sup>&reg</sup> note 
Trogdor</a>
<br>
Sprites: Zeon of <a href="http://sprites.fireball20xl.com/"> Spriters Resource</a><br>
Fueled by: <a href="http://slashdot.org">procrastination</a><br>
<br><br>
<a href=$buf>
<img border = 0 src=$buf width = "300">
</a>
<br>
Not pictured: ****, *** and *****
<br><br>
contact:
<font color=#80E0F0> pengo<FONT 
FACE="Wingdings">&#91</font>yikes.com</font>
<br><br>
<center>
Samus Approved<br>
<a href="http://www.yikes.com/~pengo/images/Pixel_art/">
<img src="http://www.yikes.com/~pengo/images/Pixel_art/thumbnails/Samus_lightoff.jpg">
</a><br>
</center>
<br>
Thanks to all the image mirrors for helping us through the /.'ing<br><br>

www.acm.jhu.edu/~eric/<BR>
www.modestolan.com/~pills/<br>
www.right-net.com/~samson/<br>
web.mit.edu/~gosh_d/<br>
hkn.icsl.ucla.edu/~tom/<br>
www.ucolick.org/~inio/<br>
xserve.berkeley.edu/eap/<br>
mirrordot.org/<br><br>

no thanks to people.ucsc.edu for banning referals from yikes, heh<br>
and sorry for crashing web02! (soe.ucsc.edu)<br>

</body>
</html>

END_OF_THE_LINE
