Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/local/bin/perl
- #
- #
- # Prophet Communications 1997
- # DaftPunk web filter routines. These were essentially
- # a hack.. Sorry to say it. Everything works, but it aint to
- # pretty. HTML these days is getting way too diverse for this
- # kind of funnery. But hey, what the hell....
- # Jim Mathies July 97
- # jim@prophetcomm.com
- #
- #
- $| = 1;
- #flushes stdout buffer
- require "/usr/html/webhome2/virgin/cgi-bin/daftpunk/url_getsub.pl";
- require "getopts.pl";
- &Getopts(':bdhclo:');
- print "Content-Type: text/html\n\n";
- ####debug command line stuff:
- $url = $ARGV[0];
- ####
- if ($ENV{'REQUEST_METHOD'} eq 'GET')
- {
- $buffer = $ENV{'QUERY_STRING'};
- @pairs = split(/&/, $buffer);
- foreach $pair (@pairs)
- {
- ($name, $value) = split(/=/, $pair);
- $value =~ tr/&/ /;
- $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
- $contents{$name} = $value;
- }
- $filter = $contents{'filter'};
- $url = $contents{'address'};
- }
- if ($ENV{'REQUEST_METHOD'} eq 'POST')
- {
- read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
- @pairs = split(/&/, $buffer);
- foreach $pair (@pairs)
- {
- ($name, $value) = split(/=/, $pair);
- $value =~ tr/+/ /;
- $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
- $contents{$name} = $value;
- }
- $page = $contents{'page'};
- $day = $contents{'day'};
- $month = $contents{'month'};
- $year = $contents{'year'};
- $dob = $month.$day.$year
- }
- #$userid = shift;
- #$passwd = shift;
- #die "$usage" if ($userid && ! $passwd);
- if($opt_o) {
- open(STDOUT, ">$opt_o") || die "Can't redirect stdout to \"$opt_o\": $!";
- open(STDERR, ">&STDOUT") || die "Can't dup stdout";
- select(STDERR); $| = 1;
- select(STDOUT); $| = 1;
- }
- print "$filter \n $address \n";
- #exit;
- if ( $filter eq 1 ) {
- $status = &url_getRainblow($url, $userid, $passwd, "&STDOUT");
- }
- if ( $filter eq 2 ) {
- $status = &url_getRedDeath($url, $userid, $passwd, "&STDOUT");
- }
- if ( $filter eq 3 ) {
- $status = &url_getBluringPain($url, $userid, $passwd, "&STDOUT");
- }
- if ( $filter eq 5 ) {
- $status = &url_getPhunk($url, $userid, $passwd, "&STDOUT");
- }
- if ( $filter eq 4 ) {
- $status = &url_getPhrench($url, $userid, $passwd, "&STDOUT");
- }
- exit $status;
- __END__
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement