#!/usr/bin/perl require '../jcode.pl'; $user = "ななしさん"; #time ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); $mon+=1; $year+=1900; $bbstime = sprintf("$user,$mail,%02d/%02d %02d:%02d:%02d\n",$mon,$mday,$hour,$min,$sec); if( $ENV{'CONTENT_LENGTH'} > 0 ) { read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $bbsdat) = split(/=/, $pair); $bbsdat =~ tr/+/ /; $bbsdat =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $bbsdat =~ s//>/g; $bbsdat =~ s/\n/
/g; $bbsdat =~ s/\r//g; } if( $bbsdat ne "" && $bbsdat =~ /[\xA1-\xFE][\xA1-\xFE]/) { &jcode'convert(*bbsdat,'euc'); open( tf, "; close(tf); $cn = @bbslog; if( $cn >= 20 ) { $cn=19; } if( $cn > 0 ) { if( index( $bbslog[0], $bbsdat) >= 0 ) { goto NEXT; } } open( tf, ">bbsdata")||die "can't access: $1\n"; printf(tf "%02d/%02d/%02d %02d:%02d:%02d", $year,$mon,$mday,$hour,$min,$sec); if( $mail eq "" ) { print tf " ● $user"; } else { print tf " ● $user"; } print tf "
$bbsdat
\n"; for($lc=0;$lc<$cn;$lc++) { print tf $bbslog[$lc]; } close( tf ); NEXT:; } } # tbbs print "Content-type: text/html\n\n"; print "\n"; print tmpf $bbstime; for (;$c<$cn;$c++) { print tmpf $bbslog[$c]; } close(tmpf); print "
\n"; print "\n"; print "\n"; print "\n"; print "

時臨示掲板

\n"; print "いらっしゃいませ $user さん
\n"; print "てきとうにお願いします。リロード
"; print "
"; print "名前:$user メールアドレス:$mail
"; print "
"; print ""; print "注:タグは書けません。改行が<br>に置き換わります。"; print "
\n"; open(fl, "bbsdata"); print while ; close(fl); print "

"; exit;