sisTR

Pro

Current Path : /services/http/users/r/ryantate/
Upload File :
Current File : /services/http/users/r/ryantate/rand_quote.cgi.~23~

#!/opt/local/bin/perl -T

#-wT
#use strict;

$ENV{PATH}='/usr/bin/';
my $Log_path="/services/http/users/r/ryantate/fplog.txt";
my @quotes=(
	    "Beyond Burgundy.",
	    qq@"Wretched excess is just barely enough." --S.O. Corriher@,
	    qq@"I loved the medium, and I'll be there in that rundown shanty town until the next wave of settlers comes through." --H. Havrilesky@,
	    qq@"His command of rhetorical writing is quite strong." --<a href="http://archive.dailycal.org/archive/1999/4/20/tate.html">O. Wang</a>@,
	    qq@"Although it might sound strange, I wept when I read the column." --<a href="http://archive.dailycal.org/archive/98/12/8/letters.html">P. Chen</a>@,
qq@"... to lie awake some night, beyond the reach of warm milk, phenobarbital, and the sleeping hand on the coverlet ..." --J. Didion@
	   );
my @no_notify_host_regexes=('morgue[^.]*\.corp\.yahoo\.com','googlebot', '64\.241\.243\.65','inktomi','bot\b','\bbot','looksmart','fastsearch','search','directhit','jeeves');
my @no_notify_referer_regexes=('images.google');
my @no_notify_agent_regexes=('bot','robo','crawler','spider','libwww','perl');

if (open LOG, ">>$Log_path") {
  my $host = ($ENV{'REMOTE_HOST'} || $ENV{'REMOTE_ADDR'} || '--unknown--');
  my $hostname;
  if ((($hostname) = $host =~ /([0-9.]+)/) && ($hostname=`/opt/local/bin/nslookup $hostname`) && (($hostname) = $hostname =~ /Name\:\s*([^\s]+)/)) {
    $host=$hostname;
  }
  my $agent=($ENV{'HTTP_USER_AGENT'} || '--unknown--');
  my $referer=  ($ENV{'HTTP_REFERER'} || '--none--');
  print LOG scalar localtime() . "\t" . $host . "\t" . $referer . "\t" . $agent . "\n";
  close LOG;
  unless ((grep {$host =~ /$_/i } @no_notify_host_regexes) || (grep {$agent =~ /$_/i} @no_notify_agent_regexes) || (grep {$referer =~ /$_/i} @no_notify_referer_regexes)){
    if (open (SENDMAIL, "| /usr/lib/sendmail -t -n")) {
      print SENDMAIL "From: Home Page <ryantate\@ocf.berkeley.edu>\nTo: 4156406119\@mobile.att.net\nSubject: Visit logged.\n\nfrom $host --- via $referer";
      close SENDMAIL;
    }
  }
}

print "Content-type: text/html\n\n";
print $quotes[rand @quotes];

Copyright 2K16 - 2K18 Indonesian Hacker Rulez
Copyright sisTR