Article View: news.software.nn
Article #6543Re: trn VS nn battle - help needed
From: Tom Christiansen
Date: Mon, 07 Nov 1994 16:45
Date: Mon, 07 Nov 1994 16:45
80 lines
3151 bytes
3151 bytes
[news followup also cc'd via email]
:-> In news.software.readers, lazlo@mack.rt66.com (Lazlo Nibble) writes:
:Tom Christiansen <tchrist@mox.perl.com> writes:
:
:> I'd add right at the top.
:>
:> - does not thread
:
:This is the only major problem I have with nn. It's obviously not big
:enough to make me use trn instead, but it's mighty close. If not for nn's
:more powerful killfile facility, I'd almost certainly be using trn now --
:threading is *nice*.
How would you like this kind of kill file processing:
if ( $Headers{"subject"} =~ /^(Re:\s*)+/ &&
! $Headers{"references"} &&
{
junk Subthread;
}
if ( $Headers{"newsgroups"} =~ /alt\.flame/ ) {
junk Article;
# or maybe just
junk $CURRENT;
}
foreach $personage ( split /\n\s*/, <<EOFOLKS)
Dennis Ritchie
Wayne Davison
Larry Wall
Rick Adams
EOFOLKS
{
$Famous{$personage} = 1;
}
if ( $Famous { $Headers{"from" } } ) { select Thread }
if ( $Headers{"from"} eq percent_interp("%L") ) {
save Article percent_interp("%p/myarticles"):
}
if ( $References =~ /evilhost/ ) {
$parent = $References[$#References];
%hisheaders = fetch_headers $parent;
if ($hisheaders{"from"} =~ /silly_person/ ) {
junk $CURRENT;
}
}
Yes, I'm thinking about embedding perl in trn to handle its
kill/select processing. The code above is just off-the-cuff,
cooked up in the last 7 minutes.
(I'm using junk, select, save, etc as methods for the Thread, Article,
and Subthread classes. )
Some common things like the Famous and Notorious lists could be
abstracted out into well known functions.
Percent interpolation would be supported via a callback into trn
from the perl code. (So as not to keep same thing in two places.)
You might want all the headers stored in %Headers (canonicalized
to lower-case) and/or you might want separate $Date, $Subject,
$Message_ID, etc variables. An @References variable would be good,
as well as a way to get at some of the article and header fetching
stuff.
Just a thought.....
--tom
--
Tom Christiansen Perl Consultant, Gamer, Hiker tchrist@mox.perl.com
Refer does not rhyme with deafer.
Foeffer does, and zephyr, heifer.
Technical Details
Message-ID:
<39llit$o0n@csnews.cs.Colorado.EDU>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.nn.mbox.zip!nntp.gmd.de!Germany.EU.net!EU.net!news.sprintlink.net!howland.reston.ans.net!agate!boulder!csnews!mox!tchristReferences:
<cheema.783657043@nntp.msstate.edu> <39av5m$niv@news.halcyon.com> <39lcoa$krq@csnews.cs.Colorado.EDU> <39lfh4$6og@mack.rt66.com>Show Full Headers
Complete Article Headers
Message-ID: <39llit$o0n@csnews.cs.Colorado.EDU> Subject: Re: trn VS nn battle - help needed Date: Mon, 07 Nov 1994 16:45:17 +0000 From: Tom Christiansen <tchrist@mox.perl.com> References: <cheema.783657043@nntp.msstate.edu> <39av5m$niv@news.halcyon.com> <39lcoa$krq@csnews.cs.Colorado.EDU> <39lfh4$6og@mack.rt66.com> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.nn.mbox.zip!nntp.gmd.de!Germany.EU.net!EU.net!news.sprintlink.net!howland.reston.ans.net!agate!boulder!csnews!mox!tchrist Newsgroups: news.software.nn,news.software.readers Organization: Perl Consulting and Training Lines: 80 Reply-To: tchrist@mox.perl.com (Tom Christiansen) NNTP-Posting-Host: perl.com Keywords: trn VS nn Originator: tchrist@mox