Article View: news.software.readers
Article #234872Re: [slrn] turbo-plonk.sl improved (Was: Can I make a rule that will auto-ignore all follow-ups to a certain author?)
From: Troy Piggins
Date: Fri, 31 Jul 2009 22:15
Date: Fri, 31 Jul 2009 22:15
77 lines
4006 bytes
4006 bytes
* John E. Davis wrote :
> On Sat, 01 Aug 2009 00:16:22 +1000, Troy Piggins <usenet-0907@piggo.com>
> wrote:
>> 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 is a version that deals directly with the scorefile and should be
> a bit faster. --John
>
> #v+
> private variable Scorefile_Score = -666;
> private variable Subthread_Score = -9998;
> private variable Subthread_Expires = 21;
> private define auto_kill_fups ()
> {
> if (is_group_mode ())
> error (_function_name () + " doesn't work in group mode!");
>
> uncollapse_threads ();
> call ("header_bob");
> EXIT_BLOCK
> {
> call ("header_bob");
> collapse_threads ();
> }
>
> variable mid, msgids = {};
>
> do
> {
> if (Scorefile_Score == get_header_score ())
> {
> mid = extract_article_header ("Message-ID");
> list_append (msgids, mid);
> set_header_flags(get_header_flags() | HEADER_READ);
> }
> }
> while (header_down(1));
>
> if (length (msgids) == 0)
> return;
>
> variable
> scorefile = make_home_filename (get_variable_value ("scorefile")),
> expires = strftime("%m/%d/%Y",
> localtime(_time() + Subthread_Expires*86400)),
> fp = fopen (scorefile, "a");
>
> if (fp == NULL)
> throw IOError, "Unable to open $scorefile"$;
>
> if ((-1 == fprintf (fp, "\n%%BOS\n%% Score auto generated by %s at %s\n",
> _function_name (), time ()))
> || (-1 == fprintf (fp, "[%s]\n\tScore:: %d\n\tExpires: %s\n",
> current_newsgroup (), Subthread_Score, expires)))
> return;
>
> foreach mid (msgids)
> {
> if (-1 == fprintf (fp,"\tReferences: %s\n",
> str_quote_string (mid, "\\^$[]*.+?", '\\')))
> return;
> }
> () = fprintf (fp, "%%EOS\n");
> () = fclose (fp);
> reload_scorefile (1);
> }
>
> () = register_hook ("article_mode_hook", &auto_kill_fups);
> #v-
Fantastic! Works beautifully! Thankyou master!
--
Troy Piggins
Technical Details
Message-ID:
<20090801081455@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-mailReferences:
<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> <20090731235846@usenet.piggo.com> <slrnh769m0.nk4.jed@aluche.mit.edu>Show Full Headers
Complete Article Headers
Message-ID: <20090801081455@usenet.piggo.com> Subject: Re: [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 08:15:50 +1000 From: Troy Piggins <usenet-0908@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> <20090731235846@usenet.piggo.com> <slrnh769m0.nk4.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: 77 Reply-To: usenet-0908@piggo.com X-Trace: news.eternal-september.org U2FsdGVkX1+U2hDWfITuMxTQ/VV+JleZvH49s1IJ04twbeA2lhGlSEAUAHShDbXhTiUE83mg23ts2Oe5FndfZMEiYUCxxnliivl8BgR1x41bc4WLeXvmshlbongB8nMtrjZXz3nuY4U= X-Complaints-To: abuse@eternal-september.org NNTP-Posting-Date: Fri, 31 Jul 2009 22:13:20 +0000 (UTC) X-Auth-Sender: U2FsdGVkX1/OIW61ADpYZrykyWQFZmQKICrYNte8Sc7POCUC4UeaTQ== X-NNTP-Proxy: Leafnode-2 (http://www-dt.e-technik.uni-dortmund.de/~ma/leafnode/beta/) Cancel-Lock: sha1:yjktZChXpsDMzEjhsZSJPVPX4T8= User-Agent: slrn/pre1.0.0-11/rt (Linux)