🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #234875

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

#234875
From: Keith
Date: Fri, 31 Jul 2009 23:00
85 lines
4367 bytes
On 2009-07-31, Troy Piggins <usenet-0908@piggo.com> wrote:
> * 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!
>

 How does this work? Is it key bound or run automatically. I don't
see anything in the macro for a key and when I added it to slrn
as a macro it did nothing. 


-- 
Best Regards, Keith
http://home.comcast.net/~kilowattradio/
Technical Details
Message-ID: <SHKcm.422414$Xo1.190161@en-nntp-07.dc1.easynews.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!transit4.hitnews.eu!feeder3.cambriumusenet.nl!feed.tweaknews.nl!94.232.116.15.MISMATCH!ramfeed-1.ams.xsnews.nl!border-3.ams.xsnews.nl!feed.xsnews.nl!border-1.ams.xsnews.nl!news.glorb.com!news2.glorb.com!news-in-01.newsfeed.easynews.com!easynews!core-easynews-01!easynews.com!en-nntp-07.dc1.easynews.com.POSTED!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> <20090731235846@usenet.piggo.com> <slrnh769m0.nk4.jed@aluche.mit.edu> <20090801081455@usenet.piggo.com>

Show Full Headers
Complete Article Headers
Message-ID: <SHKcm.422414$Xo1.190161@en-nntp-07.dc1.easynews.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: Fri, 31 Jul 2009 23:00:02 GMT
From: Keith <kilowattradio@use-reply-to.invalid>
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> <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!transit4.hitnews.eu!feeder3.cambriumusenet.nl!feed.tweaknews.nl!94.232.116.15.MISMATCH!ramfeed-1.ams.xsnews.nl!border-3.ams.xsnews.nl!feed.xsnews.nl!border-1.ams.xsnews.nl!news.glorb.com!news2.glorb.com!news-in-01.newsfeed.easynews.com!easynews!core-easynews-01!easynews.com!en-nntp-07.dc1.easynews.com.POSTED!not-for-mail
Newsgroups: news.software.readers
Organization: http://slrn.org/ Open Source Software
Reply-To: kilowattradio@gmail.com
X-No-Archive: Yes
User-Agent: slrn/pre1.0.0-11 (Darwin)
Lines: 85
X-Complaints-To: abuse@easynews.com
X-Complaints-Info: Please be sure to forward a copy of ALL headers otherwise
 we will be unable to process your complaint properly.