#!/usr/local/bin/perl use lib qw( /home/1/motchie/lib ); use Jcode; require 'oops.pl'; require 'head.pl'; require 'foot.pl'; require 'tcp.pl'; require 'chkemail.pl'; require 'cgi.pl'; &cgi'Decode; $query = $cgi'TAGS{'keyword'}; $service = "79"; $cur = << "EOF"; Internet Resource Center > finger > WWW to finger Gateway > Oops EOF $con = << "EOF";

入力されたE-Mailアドレスが不正です。
E-Mailアドレスを入力し直しておためし下さい。

WWW to finger Gatewayへ戻る

EOF print $query; if (substr($query,0,1) ne "@") { unless (&email_check($query)) { &cgi'Header; &oops($cur, $con); exit(0); } } ($username, $remote_host) = split (/@/, $query, 2); &open_TCP(FINGER, $remote_host, $service) || die &oops($cur, $con); print FINGER $username, "\n"; while () { @lines = ; } close(FINGER); unless ( $#lines == -1 ) { &cgi'Header; $des = "finger gatewayの検索結果のページです。"; $cur = <<"EOF"; Internet Resource Center > finger > WWW to finger Gateway > finger query: $username\@$remote_host EOF $tit = "finger query: $username\@$remote_host"; $hea = "WWW to finger Gateway"; &head($des, $cur, $tit, $hea); print << "EOF";
EOF

$mail_regex =
q{(?:[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+(?![^(\040)<>@,;:".\\} .
q{\[\]\000-\037\x80-\xff])|"[^\\\x80-\xff\n\015"]*(?:\\[^\x80-\xff][} .
q{^\\\x80-\xff\n\015"]*)*")(?:\.(?:[^(\040)<>@,;:".\\\[\]\000-\037\x} .
q{80-\xff]+(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff])|"[^\\\x80-\\} .
q{xff\n\015"]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015"]*)*"))*@(?:[^(\0} .
q{40)<>@,;:".\\\[\]\000-\037\x80-\xff]+(?![^(\040)<>@,;:".\\\[\]\000} .
q{-\037\x80-\xff])|\[(?:[^\\\x80-\xff\n\015\[\]]|\\[^\x80-\xff])*\])} .
q{(?:\.(?:[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+(?![^(\040)<>@,;} .
q{:".\\\[\]\000-\037\x80-\xff])|\[(?:[^\\\x80-\xff\n\015\[\]]|\\[^\x} .
q{80-\xff])*\]))*};

foreach $line (@lines) {
   $line = Jcode -> new( $line ) -> euc;
   $line = Jcode -> new( $line ) -> tr('0-9A-Za-z−', '0-9A-Za-z-');
  $line =~ s//\>/g;
  $line =~s#(http://[^()<>\[\]{}"'\x7F-\xFF\x00-\x20]+)#$1#g;
  $line =~s#($mail_regex)#$1#g;
  $line =~ s/\"/\"/g;
  $line =~ s/href\=\"/href\=\"/g;
  $line =~ s/\"\>/\">/g;
  $line =~ s/\t/    /g;
  print $line;
}

print "
\n"; &foot(); exit(0); }