#!/usr/local/bin/perl #use CGI; #$in = new CGI; $ip = $ENV{'REMOTE_ADDR'}; if (1) { print ("Content-type: text/html \n\n"); print < Echo Music Conference
The Echo Music Conference
Musical Events Calendar
has been taken down temporarily...

Try here instead:
WFMU's Arbitrary Guide To Popular Culture

Echo Music Conference

EOF exit; } else { $debug = 0; } $color1 ="bbbbbb"; $color2 ="dddddd"; @days = ("Sun","Mon","Tue","Wed","Thu","Fri","Sat"); @monthname = ("","January","February","March","April","May","June","July","August","September","October","November","December"); @monthday = ("") x 31; ($sec,$min,$hour,$mday,$mon,$cyear,$wday,$yday,$isdst)=localtime(time); $mon = $mon + 1; if ($mon < 10) { $mon = "0".$mon; } if ($mday < 10) { $mday = "0".$mday; } $cyear = $cyear + 1900; $currdate = $cyear.$mon.$mday; $testmon= $cyear.$mon; if ($debug >= 1) { print ("Content-type: text/html \n"); print "\n"; print "$ip
\n"; print "y=$year m=$mon d=$mday\n"; } $database='/home/music/public_html/cgi-bin/events/eventdb'; $errhead = "Content-type: text/html \n\n"; #open database file dbmopen(%DATABASE,$database, undef) || die "$errhead Can't open $database: $!\n"; #dbmopen(%DATABASE,$database, 0644) || die "Can't open $database: $!\n"; # PRINT OUT RETURN PAGE print ("Content-type: text/html \n"); print "\n"; print < Echo Music Conference: Selected NYC-Area Musical Events
Echo Music Conference:
Selected NYC-Area
Musical Events Calendar

EOF while (($key,$value) = each %DATABASE) { $sortlist[$i] = $value; $i++; } @sorted = sort numerically (@sortlist); @resorted = reverse (@sorted); #while (($key,$value) = each %DATABASE) { # ($event,$venue)= split(/~/, $value); for ($j=0;$j<$i;$j++) { ($date,$event,$venue,$usrip)= split(/~/, $resorted[$j]); $year = substr ($date,0,4); $month = substr ($date,4,2); $testmonth = $year.$month; $day = substr ($date,6,2); if ($debug >= 1) { print "date = $date/$currdate | "; print "month = $month | "; print "day = $day | "; print "event = $event | "; print "venue = $venue

\n"; } #IF IT"S A NEW MONTH PRINT A HEADER if ($month != $oldmonth) { if ($testmonth >= $testmon) { print_month($month); } load_dates($month,$year); $oldmonth = $month; } #PRINT THE EVENT LINE if ($date != $olddate) { $olddate = $date; $tempcolor = $color1; $color1 = $color2; $color2 = $tempcolor; } if ($date >= $currdate) { print_row($tempcolor,$month,$day,$event,$venue); } else { if ($debug >= 1) { print_row($tempcolor,"00","00","old event",$date); } } } # PRINT THE BOTTOM OF THE PAGE print <

Echo Music Conference

WFMU's Arbitrary Guide To Popular Culture

Not responsible for changes, typographical errors,
questionable taste, or slackness in keeping this updated.
Questions and info to jneil\@echonyc.com

EOF dbmclose(%DATABASE); exit(); sub print_month { my ($month) = @_; $month = $month * 1; print "
"; } sub print_row { my ($color,$month,$day,$event,$venue) = @_; $month = $month * 1; $day = $day * 1; print "\n"; } sub numerically { $b <=> $a;} sub load_dates { my ($mon,$year) = @_; my $infile = "/home/music/public_html/cgi-bin/events/date_temp.txt"; $mon = $mon * 1; $year = $year * 1; if ($debug >= 1) { print "mon=$mon year=$year infile=$infile
\n"; } # PRINT THE SYSTEM CALENDAR FOR THIS MONTH TO THE TEMP FILE system(`cal $mon $year > $infile`); my $calct = 0; my $line = ""; my $i = 0; # READ THE TEMP FILE IN open(INFILE, "$infile") || die; while($line = ) { if ($calct < 2) { } else { chomp $line; # FILL IN DUMMY CHARACTER SO THAT THE LINE WILL SPLIT CORRECTLY $line =~ s/ /- /g; # GET RID OF LEADING BLANK IF A SINGLE-DIGIT DATE STARTS A LINE if (substr($line,0,1) eq " " && substr($line,1,1) ne " ") { $line = substr($line,1,(length($line))-1); } # SPLIT LINE INTO TEMP ARRAY (@temp) = split /\s+/, $line; for ($i=0;$i<7;$i++) { if ($temp[$i] ne "-") { $monthday[$temp[$i]] = $days[$i]; if ($debug >= 1) { # print "$i: temp=$temp[$i] monthday=$monthday[$temp[$i]] days=$days[$i]
\n"; } } } } $calct++; } close INFILE; system(`rm $infile`); }
"; print "

 "; print $monthname[$month]; print "

"; print "$monthday[$day], $month/$day"; print ""; print $event; print ""; print $venue; print "