#!/usr/bin/perl use Net::NNTP; # this comes from libnet.pm use Text::CSV_XS; # unfortunately have to install both these modules. #use CGI qw(:standard escapeHTML); use CGI qw(:standard ); use CGI::Carp qw(fatalsToBrowser); use File::Copy; %CONF = (); %URL = (); %EMAIL = (); @KEYWORDS = (); @NEWS_GROUPS = (); @NEWS_SERVERS = (); $page = ""; undef (@EXCLUDE); $| = 1; $html = 0; $verbose = 0; $msg2 = ""; print STDERR "Got here"; if (-t STDIN && -t STDOUT) { $html = 0; } else { $html = 1; } process_config_file(); print STDERR "Got here2"; if (! $html) { # if interactive, want to print to output file. print "Interactive\n"; check_config(); print "Starting search...\n"; open STDOUT, "> $CONF{OUTPUT}"; search(); } else { # want to print HTML $query = new CGI(); print $query->header (-TYPE=>'text/html'); print $query->start_html ('Deb\'s Newsgroup Search'); print "
"; unless (param) { PrintForm ($verbose); } print STDERR "Got here4"; if ($query->param('action') eq 'Save') { if (CheckConfig()) { SaveConfig (); process_config_file(); } PrintForm($verbose); } if ($query->param('action') eq 'Search') { if (CheckConfig()) { print "<\/a>\n"; print "