🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #234868

[slrn] turbo-plonk.sl improved (Was: Can I make a rule that will auto-ignore all follow-ups to a certain author?)

#234868
From: Troy Piggins
Date: Fri, 31 Jul 2009 14:16
104 lines
5142 bytes
* John E. Davis wrote :
>* Troy Piggins wrote :
> 
>> Upon entering the group it does take some time going through all
>> the articles to add them to the scorefile.  And I'm running a
>> local leafnode server.  Wonder how sluggish it'd be on dialup and
>> a remote news server.
>
> I suspect that it is because it is overly aggressive in deleting
> perfectly good email addresses.  You might see some improvement by
> using the onigurama or pcre regexp modules.  They will allow you to
> use a precompiled regular expresson.  Also, the REs themselves should
> be rewritten to limit backtracking.  For example,
<snip />
> Finally, I suspect that these REs were designed to check the syntax of
> the email addresses.  But as pointed out by Ralf, these REs are not
> enough because they fail to match perfectly valid email addresses.  If
> this is the intent then it would probably be better to make the
> slrn_parse_rfc2822_addr function available to the interpreter.  In
> fact, the code is already in interp.c, but it is commented-out.

Ok.  I've had a bit of a think about it now.  I didn't really
like the way it was handling the "From" searching.  And it was
all hard coded into the macro.  Very hard to add to etc.

So I thought about this, and I can't remember where I had seen
the idea originally, but what if we acted on a particular score
instead.  Keeps it in a separate file.  Means it doesn't matter
if you want to kill on the "real name", "email address", what
format they're in, whatever.

Let's pick -666 as the score.  Upon entering a group, any article
with a score of -666 will automatically cause any articles with
it's Message-ID in their References to be killfiled.

Here's a sample score:

#v+
[*]
Score:: =-666 % followups to this will be killfiled
From: Annoying Poster
From: Another Annoying Poster
#v-

And here's the updated macro.  It kind of works, and it's much
faster than the original.  But for some reason I can't figure out
at the moment, it doesn't add killfile entries for all of the
Message-IDs of posts with score of -666.  In testing it only
seemed to catch the last 3.

#v+
define ignore_subthread ()
{
   if (is_group_mode ())
     error (_function_name () + " doesn't work in group mode!");

% 1814400 is 21 days in seconds.  haven't figured out how to do
% this better yet.
   variable tm = localtime(_time () + 1814400);

   set_input_string (strcat("-9998\n", strftime("%m/%d/%Y", tm)));
   set_input_chars ("rty");
   call ("create_score");
}

define auto_kill_fups ()
{
   if (is_group_mode ())
     error (_function_name () + " doesn't work in group mode!");

   uncollapse_threads;
   call ("header_bob");

   do
     {
       variable score = get_header_score ();

       if (-666 == score) {
             variable mid = extract_article_header("Message-Id");
             set_header_flags(get_header_flags() | HEADER_READ);
             ignore_subthread();
       }
     } while (header_down(1));

   call ("header_bob");
   collapse_threads;
}

define article_mode_hook ()
{
	auto_kill_fups () ;
}
#v-

Note the section about 21 days in seconds.  Need a better way to
do that.

Not using pipes any more, though, as JED recommended.

Took out some of the bits of original version that appeared
redundant.  Were they?

-- 
Troy Piggins
Technical Details
Message-ID: <20090731235846@usenet.piggo.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!border1.nntp.ams.giganews.com!nntp.giganews.com!feeder.erje.net!feeder.eternal-september.org!eternal-september.org!not-for-mail
References: <guhtt9$82j$1@news.motzarella.org> <slrnh0p4lk.9q2.catwheezel@ID-107770.user.individual.net> <slrnh6sm2b.be4.ShadowTek@desktop.localdomain> <20090729080451@usenet.piggo.com> <slrnh6v215.m8d.ShadowTek@desktop.localdomain> <20090729101510@usenet.piggo.com> <slrnh6vnoo.8ce.ShadowTek@desktop.localdomain> <slrnh73i74.imu.jed@aluche.mit.edu> <20090731083455@usenet.piggo.com> <slrnh749g4.qr1.usenet@news.piggo.com> <slrnh74t48.4ch.jed@aluche.mit.edu>

Show Full Headers
Complete Article Headers
Message-ID: <20090731235846@usenet.piggo.com>
Subject: [slrn] turbo-plonk.sl improved (Was: Can I make a rule that will auto-ignore all follow-ups to a certain author?)
Date: Sat, 01 Aug 2009 00:16:22 +1000
From: Troy Piggins <usenet-0907@piggo.com>
References: <guhtt9$82j$1@news.motzarella.org> <slrnh0p4lk.9q2.catwheezel@ID-107770.user.individual.net> <slrnh6sm2b.be4.ShadowTek@desktop.localdomain> <20090729080451@usenet.piggo.com> <slrnh6v215.m8d.ShadowTek@desktop.localdomain> <20090729101510@usenet.piggo.com> <slrnh6vnoo.8ce.ShadowTek@desktop.localdomain> <slrnh73i74.imu.jed@aluche.mit.edu> <20090731083455@usenet.piggo.com> <slrnh749g4.qr1.usenet@news.piggo.com> <slrnh74t48.4ch.jed@aluche.mit.edu>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!border1.nntp.ams.giganews.com!nntp.giganews.com!feeder.erje.net!feeder.eternal-september.org!eternal-september.org!not-for-mail
Newsgroups: news.software.readers
Organization: A noiseless patient Spider
Lines: 104
Reply-To: usenet-0907@piggo.com
X-Trace: news.eternal-september.org
 U2FsdGVkX19k2AC83NZ3SC4pSWv/pjjIFGa2zLG6/Spm/8MQYiIgHprQ0mYV5chd9elmRDgmN+BioDOszhP2XGl+Jg+2Gn6knDOimxEG4xebgvuWmXCqvDAttZ6rLcrDxQoe8+pavgjxqA5RGF12EbB/vxbWAWf0
X-Complaints-To: abuse@eternal-september.org
NNTP-Posting-Date: Fri, 31 Jul 2009 14:21:02 +0000 (UTC)
X-Auth-Sender: U2FsdGVkX199ODV8SYjXbJlHtHFZiKayDxQ09no8vI18AjBGAXrgdQ==
X-NNTP-Proxy: Leafnode-2
 (http://www-dt.e-technik.uni-dortmund.de/~ma/leafnode/beta/)
Cancel-Lock: sha1:6R5CflWxdHQCFuixqRT4ALkUUZg=
User-Agent: slrn/pre1.0.0-11/rt (Linux)