🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #44082

Some kludge for slrn. Run after expire.

#44082
From: Stefan Scholl
Date: Tue, 27 Oct 1998 00:00
65 lines
1881 bytes
#! /usr/bin/perl -w

# fixnewsrc4slrn
#
# slrn has problems with ranges. This is a kludge to fix it.
#                                          ~~~~~~

# $Id: fixnewsrc4slrn,v 1.2 1998/01/02 13:39:52 stesch Exp stesch $


use News::Newsrc;          # needs Set::IntSpan
use News::NNTPClient;


# --> defined globals

$newsrc   = '.jnewsrc';

# <-- defined globals


# globals
#
# $nr     := News::Newsrc object.
# $nn     := News::NNTPClient object.



$nr = new News::Newsrc;
$nr->load($newsrc) || die "Can't open $newsrc: $!\n";

$nn = new News::NNTPClient || die "Can't connect to NNTP-server\n";

$nn->mode_reader();

@subs = $nr->sub_groups(); # subscribed groups


foreach $sg (@subs) {
    print "\n$sg ";
    
    next unless ($first, $last) = $nn->group($sg);
    next if $first <= 1;

	$nr->mark_range($sg, 1, $first - 1);	# lomark.

    # Now we have to check all the unread articles for existence
    
    $ne = 0; # counter for non-exitent and unread articles
	foreach $art ($nr->unmarked_articles($sg, $first, $last)) {
        unless($nn->stat($art)) { # if non-existent
        	$ne++;
        	$nr->mark($sg, $art);
        }
    }

    print "$first - $last ($ne)";
}

print "\n";

$nr->save();

Technical Details
Message-ID: <slrn73bnba.1fh.stesch@parsec.rhein-neckar.de>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail

Show Full Headers
Complete Article Headers
Message-ID: <slrn73bnba.1fh.stesch@parsec.rhein-neckar.de>
Subject: Some kludge for slrn. Run after expire.
Date: Tue, 27 Oct 1998 00:00:00 +0000
From: stesch@parsec.rhein-neckar.de (Stefan Scholl)
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail
X-Deja-AN: 405581545
Organization: private site
X-Server-Date: 27 Oct 1998 14:49:14 GMT
User-Agent: slrn/0.9.5.3 (UNIX)
Newsgroups: news.software.readers