Subject: Newsgroup Crossposting War

From: Paul O Bartlett <[email-masked]>
Date: Sat, 20 Jul 1996 12:08:12 -0400

I have been using Pine for quite some time now with high
satisfaction.  I use procmail to take case of my mail filtering needs. 
However, the lack of filtering/killfile tools for newsgroups has become
a bit of a problem.

    A serious sci.* newsgroup I follow has gotten caught in a
crossposting war which has now become a flaming crossposting war, all
because some careless or thoughtless people started some threads and
crossposted them irresponsibly to various marginally relevant or
irrelevant groups.  The result is that the sci.* group I follow is
getting swarmed under by irrelevant postings, some of them verging on
the malicious.  Pine's lack of killfile capability makes sorting
through the trash to find the "real" postings a chore.

    I am wondering if anyone has come up with a way around this sort of
thing (other than switching to a different reader with killfiles)? 
About all I can think of is something like a Perl or Python script
which would scan a killfile list, examine the unread postings in that
newsgroup, and massage .newsrc, although that doesn't seem like a very
clean way of doing things, and I myself am not in a position to write
such a script.  Anybody got any ideas?  Thanks.

Paul                             <[email-masked]>
----------------------------------------------------------
Paul O. Bartlett, P.O. Box 857, Vienna, VA 22183-0857, USA
Finger, keyserver, or WWW for PGP 2.6.2 public key 
Home Page:  URL: http://www.access.digex.net/~pobart

---

From: [email-masked] (Tim Mooney)
Date: 24 Jul 1996 18:27:11 -0500

[posted & cc'ed]

In article <[email-masked]>,
> such a script.  Anybody got any ideas?  Thanks.

I wouldn't reinvent the wheel *if* you have access to trn on your system.
Even if you don't want to use trn for newsreading (though you should! :-) )
you can still use it for killing articles.

I thought for sure trn had some spanky command line option to allow you
to start up in a group and run your ``memorized commands'' immediately
(thereby killing articles), but I can't find it in the faq or documentation
anywhere.  No matter, we can roll our own.

Here's what you can try:

1) start up trn in the group you want to read, and set up your kill file.
Being you know what a killfile is and are sophisticated enough to filter
your email via procmail I'll assume you can figure out how to set up a trn
killfile (if not, consult the killfile & trn faqs on news.software.readers).

2) All you then need to do is start up trn and enter the group you want to
filter, then quit trn.  You can do that either manually or (if you also
have `expect' on your system) you can do it with an expect script.  The
script might look something like this:

#!/usr/local/bin/expect

#A quick hack to start up trn in the newsgroup passed as the first argument
#on the command line, run the killfile, then exit trn.  This script is not
#robust; many things could be improved.

#set newsgroup to be whatever's passed on the command line.
set newsgroup [ lindex $argv 0 ]
set timeout 30

#hide trn's output, change to `log_user 1' to watch what's happening.
log_user 0

spawn trn $newsgroup

expect {
	"*ynq] " {
		send "y\r"
	}
	timeout	{ puts "$expect_out(buffer)" ; exit }
}

expect {
	"Type space to continue]*" { send "q\r" }
	timeout { puts "$expect_out(buffer)" ; exit }
}

expect {
	"articles are selected*"	{ send "q\r" }
	"what next\? \[npq]*" 		{ send "q\r" }
	eof { exit }
}

expect {
	"End of newsgroups*" 		{ send "q\r" }
	eof { exit }
}

# one last time, just to make sure
expect {
	eof { exit }
	"End of newsgroups*" { send "q\r" }
}

log_user 1

------------end of script---------------

I'm no expect expert (so that's probably pretty terrible `expect'), but it
worked with the trn on my system.  It may work on yours too.

Once you have the script working and your killfile set up, all you would
need to do would be add the following line to your .profile or .login:

	kill.exp sci.whatever.group

By the time you get logged in, your .newsrc will be updated and you can
read news with pine.

Tim
-- 
Tim Mooney                              [email-masked]
Information Technology Services         (701) 231-1076 (Voice)
Room 242-J6, IACC Bldg.                 (701) 231-8541 (FAX)
North Dakota State University, Fargo, ND 58105

---

From: Paul O Bartlett <[email-masked]>
Date: Fri, 26 Jul 1996 11:40:09 -0400

I want to publicly thank Tim Mooney for his suggestions for using
trn as a preprocessor for newsgroups to implement a sort of killfile
before Pine reads the news.  I had to do a bit of kludging and it isn't
perfect, but it is a lot better than what I had (i.e., nothing, with
Pine).  I used the trnkill script off the 'net rather than Tim's Expect
script, and things are working reasonably well, so I don't have to plow
my way through a bunch of inappropriate trash on some flooded
newsgroups.  Thanks, Tim.

    (For everyone's information, this pseudo-killfile technique for
news only works on Un*x systems which also have a relatively recent
version of the newsreader trn.  Also, it takes a minute or two to get
the hank of trn killfiles.)