🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
14 messages
14 total messages Started by Dan Birchall Sat, 22 Aug 1998 00:00
SLRN - score/kill while checking groups?
#42865
Author: Dan Birchall
Date: Sat, 22 Aug 1998 00:00
16 lines
1181 bytes
I know this would be more expensive in terms of CPU and bandwidth
and probably unsuitable for use over dialups by any but the most
patient of us... but is there a way (maybe in s-lang?) to make
SLRN slurp all the new message headers, score/kill them based on
the .score file, and *then* display the remaining groups and
message counts?

-Dan

-- 
Dan "Shag" Birchall of Moorestown, New Jersey.  Spam delenda est!
Running Linux on a NEC Versa 2000 and riding a Cannondale SR-500.
Maisha Fan Site - http://maisha.scream.org/ - Now "Lynx-Friendly"
H.R.3888 - Congress's way of saying, "Shut up and eat your spam!"

Re: SLRN - score/kill while checking groups?
#42876
Author: Dawn Owens-Nicholson
Date: Sun, 23 Aug 1998 00:00
98 lines
4799 bytes
[I posted <slrn6tun2t.6s9.bluemoon@ux6.cso.uiuc.edu> and (of course,
 afterwards) thought of a rare situation that is easy to account for which
 might cause this macro to do the wrong thing.  This article supersedes the
 one listed above.  The second macro, basic_display_true_counts(), and the
 text are unmodified.]

Dan Birchall <djb@scream.org> wrote:
> [...] but is there a way (maybe in s-lang?) to make SLRN slurp all the new
> message headers, score/kill them based on the .score file, and *then*
> display the remaining groups and message counts?

Yes.  Keeping in mind all the caveats you mentioned, and that you didn't
mention whether you wanted to score headers for subscribed or unsubscribed
groups, groups matching a regex (or regexes), etc...you could use this which
will score all groups listed in group mode:

define display_true_counts ()
{
   variable
     was_in_group_mode = is_group_mode (),       % were we in group mode?
     message_ID = "",                            % article where we began
     article_was_visible = 0,                    % was the article visible?
     sort_method = 0,
     collapsed = 0,                              % beginning thread collapse
     group = current_newsgroup ();               % newsgroup where we began
   
   !if (was_in_group_mode)                       % record article mode stuff
     {
	message_ID = extract_article_header ("Message-ID");
	article_was_visible = is_article_visible ();
	sort_method = get_variable_value ("sorting_method");
	collapsed = is_thread_collapsed ();
	
	call ("quit");                           % get to group mode
     }
   
   EXIT_BLOCK
     {
	while (current_newsgroup () != group)    % get back to where we began
	  () = group_search (group);
	if (was_in_group_mode) return ();
	
	call ("select_group");                   % enter newsgroup
	
        set_integer_variable ("sorting_method", sort_method);

        set_input_string (message_ID);           % go to the original header
	call ("locate_header_by_msgid");         % (possibly downloading it!)

        if (extract_article_header ("Message-ID") != message_ID) return ();
	
	if (article_was_visible == 1)            % restore article mode screen
	  call ("scroll_dn");
	if (collapsed) collapse_thread ();
     }

   call ("bob");                                 % jump to the top group
   if (current_newsgroup () == "")               % nothing to do
     error ("No newsgroups listed!");

   do
     {
	ERROR_BLOCK { _clear_error (); }         % if all articles are killed
	!if (select_group ()) call ("quit");     % enter, score & leave group
     }
   while (group_down_n (1));                     % go to next newsgroup
}

In case the commenting wasn't enough, here's a basic version that makes no
attempt to restore your slrn screen (it will either error or leave you in
group mode at the last group in your group list):

define basic_display_true_counts ()
{
   !if (is_group_mode ()) call ("quit");         % get to group mode

   call ("bob");                                 % jump to the top group
   if (current_newsgroup () == "")               % nothing to do
     error ("No newsgroups listed!");

   do
     {
	ERROR_BLOCK { _clear_error (); }         % if all articles are killed
	!if (select_group ()) call ("quit");     % enter, score & leave group
     }
   while (group_down_n (1));                     % go to next newsgroup
}

One last tricky situation you might not have planned on: article marked as
read and articles killed are effectively *the same thing* when you enter
(score) and leave a newsgroup.  This is because articles neither marked read
nor killed articles will appear when you enter the group next time.  I made
an exception in the first macro for the article at the cursor when you run
display_true_counts() (unless that article has been removed from your
server, that article will reappear at the cursor when the macro is done).
I leave a bunch of enhancements as exercises for the reader.

Re: SLRN - score/kill while checking groups?
#42890
Author: Stefan Scholl
Date: Tue, 25 Aug 1998 00:00
15 lines
1230 bytes
On 25 Aug 1998 18:57:34 GMT, Jan Hlavacek <lahvak@math.mps.ohio-state.edu> wrote:
> You are using old version of slrn, and,  more importantly,  old version
> of s-lang.  Prior version 1,  s-lang couldn't do direct comparison of
> strings,  using == and != operators.  You can either upgrade your
> software,  or rewrite the macro to use strcmp instead.

Thanks!

Now the macro uses strcmp().


MfG
Stefan

Re: SLRN - score/kill while checking groups?
#42892
Author: Dawn Owens-Nicholson
Date: Tue, 25 Aug 1998 00:00
9 lines
1098 bytes
Jan Hlavacek <lahvak@math.mps.ohio-state.edu> wrote:
> You are using old version of slrn, and,  more importantly,  old version
> of s-lang.

Is this common among slrn users?  I've always kept up with the latest slrn
and S-Lang because I could (both compile easily on all the platforms where I
use them).

Re: SLRN - score/kill while checking groups?
#42894
Author: Jan Hlavacek
Date: Tue, 25 Aug 1998 00:00
21 lines
1591 bytes
On 25 Aug 1998 11:36:24 GMT, Stefan Scholl <stesch@parsec.inka.de>
wrote:
> I've no idea of slang (and there's no README.slang in the
> slrn source-tree). 

Try README.macros.

>   S-Lang Error: Operation undefined for type.: Unknown Error.

You are using old version of slrn, and,  more importantly,  old version
of s-lang.  Prior version 1,  s-lang couldn't do direct comparison of
strings,  using == and != operators.  You can either upgrade your
software,  or rewrite the macro to use strcmp instead.

-- 
Jan Hlav\'{a}\v{c}ek <lahvak@math.mps.ohio-state.edu>  (BCC's will bounce)
home page: http://www.math.ohio-state.edu/~lahvak/
slrn page: http://www.math.ohio-state.edu/~lahvak/software/slrn.html
slrn documentation: http://www.math.ohio-state.edu/~lahvak/software/slrn/

Re: SLRN - score/kill while checking groups?
#42901
Author: Stefan Scholl
Date: Tue, 25 Aug 1998 00:00
20 lines
1114 bytes
I've no idea of slang (and there's no README.slang in the
slrn source-tree). I get the following message from slrn:

  S-Lang Error: Operation undefined for type.: Unknown Error.

I've put your function into my ~/.slrn.sl (which is called from
.slrnrc). 

definekey ("display_true_counts", "F", "group");



After pressing "F" I receive the error message.



MfG
Stefan

Re: SLRN - score/kill while checking groups?
#42898
Author: Stefan Scholl
Date: Wed, 26 Aug 1998 00:00
15 lines
1279 bytes
[Please don't reply via e-mail _and_ followup!]

On 26 Aug 1998 00:03:57 GMT, Dawn Owens-Nicholson <bluemoon@ux6.cso.uiuc.edu> wrote:
> I see that the error has been answered already, but this macro also works
> from article mode, so you should be able to do the same thing from article

This was only a test. I'll run it from crontab because it's
running a bit too long. There are 392 groups in my .jnewsrc :-)
And the score-file is 67 KB big.



***Stefan

Re: SLRN - score/kill while checking groups?
#42899
Author: David Goh
Date: Wed, 26 Aug 1998 00:00
75 lines
3855 bytes
In news.software.readers, on 25 Aug 1998 23:14:25 GMT
Dawn Owens-Nicholson <bluemoon@ux6.cso.uiuc.edu> wrote:
>Jan Hlavacek <lahvak@math.mps.ohio-state.edu> wrote:
>> You are using old version of slrn, and,  more importantly,  old version
>> of s-lang.
>Is this common among slrn users?  I've always kept up with the latest slrn
>and S-Lang because I could (both compile easily on all the platforms where I
>use them).

*goes away, writes perl script to fish out X-Newsreader and similar headers*

*comes back after having run it on partial newsfeed (we get a selective
UUCP feed, mostly computer related groups, plus aus.*)*

There's no analysis relating to From addresses, so these numbers are
*purely* article count statistics...

X-Mailer       slrn (0.9.4.3 UNIX)                      1
X-Newsreader   slrn (0.8.8.2 UNIX)                      2
X-Newsreader   slrn (0.8.8.4 (BETA) UNIX)               5
X-Newsreader   slrn (0.9.2.1 BETA OS/2)                14
X-Newsreader   slrn (0.9.2.1 BETA UNIX)                 1
X-Newsreader   slrn (0.9.3.1 UNIX)                      5
X-Newsreader   slrn (0.9.3.2 UNIX)                    197
X-Newsreader   slrn (0.9.4.0 UNIX)                      7
X-Newsreader   slrn (0.9.4.1 UNIX)                      3
X-Newsreader   slrn (0.9.4.2 UNIX)                      7
X-Newsreader   slrn (0.9.4.3 OS/2)                      2
X-Newsreader   slrn (0.9.4.3 UNIX)                    557
X-Newsreader   slrn (0.9.4.3 VMS)                       1
X-Newsreader   slrn (0.9.4.5 OS/2)                      2
X-Newsreader   slrn (0.9.4.5 UNIX)                      1
X-Newsreader   slrn (0.9.4.6 UNIX)                     65
X-Newsreader   slrn (0.9.5.1 OS/2)                      6
X-Newsreader   slrn (0.9.5.1 UNIX)                     15
X-Newsreader   slrn (0.9.5.1 Windows)                  10
X-Newsreader   slrn (0.9.5.2 UNIX)                    366
X-Newsreader   slrn (0.9.5.2 WinNT 4.0 SP 3)            1
X-Newsreader   slrn (0.9.5.2 Windows)                   8
X-Newsreader   slrn (0.9.5.3 UNIX)                      1

So, if we cut that to just version numbers and article counts... that gets:

0.9.5.3:    1
0.9.5.2:  375
0.9.5.1:   31
0.9.4.6:   65
0.9.4.5:    3
0.9.4.3:  561
0.9.4.2:    7
0.9.4.1:    3
0.9.4.0:    7
0.9.3.2:  197
0.9.3.1:    5
0.9.2.1:   15
0.8.8.4:    5
0.8.8.2:    2

That's just slrn statistics on the spool here...  If anyone wants the
script to run over their own newsspool, let me know, and I'll mail it
out.  :)

Looks like more people are still using 9.4.x than have upgraded to
9.5.x, and quite a large number are still using 9.3.x.  Interesting.

Later,

   Thorf

-- 
<a href="http://www.tertius.net.au/~thorfinn/">thorfinn@tertius.net.au</a>
"Nuclear war can ruin your whole compile."
                -- Karl Lehenbauer

Re: SLRN - score/kill while checking groups?
#42900
Author: Dawn Owens-Nicholson
Date: Wed, 26 Aug 1998 00:00
20 lines
1371 bytes
Stefan Scholl <stesch@parsec.inka.de> wrote:
> I've put your function into my ~/.slrn.sl (which is called from
> .slrnrc). 
> 
> definekey ("display_true_counts", "F", "group");

I see that the error has been answered already, but this macro also works
from article mode, so you should be able to do the same thing from article
mode with this (assuming you haven't got other plans for the "F" key):

 definekey ("display_true_counts", "F", "article");

or in your slrn rc file (~/.slrnrc):

 setkey article display_true_counts "F"
 setkey group display_true_counts   "F"

after you've loaded your ~/.slrn.sl file.

Re: SLRN - score/kill while checking groups?
#42903
Author: Stefan Scholl
Date: Wed, 26 Aug 1998 00:00
17 lines
1424 bytes
On 26 Aug 1998 00:05:18 GMT, Dawn Owens-Nicholson <bluemoon@ux6.cso.uiuc.edu> wrote:
> Stefan Scholl <stesch@parsec.inka.de> wrote:
> > Now the macro uses strcmp().

> If possible for your platform, I'd recommend upgrading to the latest slrn
> and S-Lang.  It's only going to become harder to port macros back to your
> older slrn and S-Lang.

This was the first time I needed a slrn-macro.

I've changed my editor from jed to joe, due to slang. I don't
want to program programs just to configure them.


***Stefan

Re: SLRN - score/kill while checking groups?
#42905
Author: Dawn Owens-Nicholson
Date: Wed, 26 Aug 1998 00:00
21 lines
1801 bytes
David Goh <david+usenet@unico.com.au> wrote:
> *goes away, writes perl script to fish out X-Newsreader and similar headers*

Thanks, but I'm hesitant to read so much into this data.  My question
pertains to people who use macros (I don't see any point to catering to
those who don't care about macros).  For all I know, users of older versions
of slrn don't read this newsgroup, don't download macros from anywhere and
don't care what macros are.

Also, from a more technical standpoint, if nobody has problems compiling and
installing the latest S-Lang and slrn, it seems like a bad idea to write
code for older S-Lang.  There are genuinely good reasons for upgrading,
after all.

> Looks like more people are still using 9.4.x than have upgraded to
> 9.5.x, and quite a large number are still using 9.3.x.  Interesting.

Well, slrn users that post to Usenet anyhow.  Thanks for compiling the
information, though.

Re: SLRN - score/kill while checking groups?
#42908
Author: Stefan Scholl
Date: Wed, 26 Aug 1998 00:00
21 lines
1531 bytes
On 25 Aug 1998 23:14:25 GMT, Dawn Owens-Nicholson <bluemoon@ux6.cso.uiuc.edu> wrote:
> Jan Hlavacek <lahvak@math.mps.ohio-state.edu> wrote:
> > You are using old version of slrn, and,  more importantly,  old version
> > of s-lang.
> 
> Is this common among slrn users?  I've always kept up with the latest slrn
> and S-Lang because I could (both compile easily on all the platforms where I
> use them).

Never change a running system.

The annoying bugs I've found in slrn aren't fixed. So I use my
little kludge (Perl script) to fix it after eacht expire run and
wait 'till there's a new version.

Unfortunately the slrn source is unreadable.


***Stefan

Re: SLRN - score/kill while checking groups?
#42914
Author: Dawn Owens-Nicholson
Date: Wed, 26 Aug 1998 00:00
8 lines
1079 bytes
Stefan Scholl <stesch@parsec.inka.de> wrote:
> Now the macro uses strcmp().

If possible for your platform, I'd recommend upgrading to the latest slrn
and S-Lang.  It's only going to become harder to port macros back to your
older slrn and S-Lang.

Re: SLRN - score/kill while checking groups?
#42919
Author: tony summerfelt
Date: Thu, 27 Aug 1998 00:00
27 lines
1780 bytes
On 26 Aug 1998 05:10:47 GMT, David Goh wrote:

> *goes away, writes perl script to fish out X-Newsreader and similar headers*

> That's just slrn statistics on the spool here...  If anyone wants the
> script to run over their own newsspool, let me know, and I'll mail it
> out.  :)

i wouldn't mind the script. saves me from reinventing the wheel...

in return i could send you the s-lang macro i wrote to save unread news to a
file, and the perl script to restore the messages back to a local spool (i
use slrnpull here)


-- 
.t

*------------------------------------------------------------------------
| long and useless .sig removed.  email me for the 10 meg version
| ok, i'll put in one line:
| 'you want a toe? I can get you a toe.'
| take myspleen out to reply via email
*------------------------------------------------------


Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads