🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #253209

Re: [slrn] scoring, need help please

#253209
From: Mike Yetto
Date: Sat, 05 Jan 2013 15:01
86 lines
4178 bytes
In a world where andrew <andrew@skamandros.invalid>
posts to Usenet.
>On 2013-01-04, Whiskers <catwheezel@operamail.com> wrote:

>> That macro doesn't seem to have made it onto the official slrn site, but I
>> can remember using it myself to very good effect to handle a problem
>> similar to yours.  I don't know if it would need any changes to work with
>> the latest versions of slrn.  (It looks as though the macro is available
>> from <http://strcat.de/dotfiles/>, but I haven't checked whether or not
>> that is the same thing).

>I am away for a fortnight but if a few people can test turbo-plonk.sl I
>will be happy to add it to the slrn site:

>#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-

I just tested this and it works as designed. Just be sure to use
=-666 as the score to counter any other score that may have
accumulated on the triggering post.

Mike "winter isn't just coming, it's here" Yetto
-- 
In theory, theory and practice are the same.
In practice they are not.
Technical Details
Message-ID: <slrn20130105095641.927.twooffive@may.eternal-september.org>
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.dca3.giganews.com!border2.nntp.dca3.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!news.glorb.com!feeder.erje.net!us.feeder.erje.net!newsfeed.straub-nv.de!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
References: <slrnkdbua7.qr3.feranija@moose.shawcable.net> <slrnkee748.1au.catwheezel@ID-107770.user.individual.net> <20130105104431.477@skamandros.andrews-corner.org>

Show Full Headers
Complete Article Headers
Message-ID: <slrn20130105095641.927.twooffive@may.eternal-september.org>
Subject: Re: [slrn] scoring, need help please
Date: Sat, 05 Jan 2013 10:01:47 -0500
From: Mike Yetto <myetto1@nycap.invalid>
References: <slrnkdbua7.qr3.feranija@moose.shawcable.net> <slrnkee748.1au.catwheezel@ID-107770.user.individual.net> <20130105104431.477@skamandros.andrews-corner.org>
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.dca3.giganews.com!border2.nntp.dca3.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!news.glorb.com!feeder.erje.net!us.feeder.erje.net!newsfeed.straub-nv.de!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
Newsgroups: news.software.readers
Organization: slrn Mafia / Xnews Tong (emeritus)
Lines: 86
Injection-Info: may.eternal-september.org;
 posting-host="c462a9a6983fa86956c145eef1f34f4c";
 logging-data="13671"; mail-complaints-to="abuse@eternal-september.org";
 posting-account="U2FsdGVkX1/gRCzazvY3QfnPAq/XTLHFAOFu1IELhGM="
User-Agent: slrn/1.0.1 (Linux)
X-The-Usenet-Improvement-Project: http://twovoyagers.com/improve-usenet.org/
X-No-Bananas: Yes (except Ray)
Cancel-Lock: sha1:uwAxTXdSiWl7BWtk+7wsYKOiIn4=
 sha1:cXGP3E1/NxTDugJrefbh+QBAD3o=
X-Original-Bytes: 3959