Article View: news.software.nntp
Article #33727Re: Netscap 4.x as a News Reader....
From: Fluffy
Date: Fri, 11 Dec 1998 00:00
Date: Fri, 11 Dec 1998 00:00
60 lines
2481 bytes
2481 bytes
On 11 Dec 1998, Fluffy wrote:
{of active.times ickiness}
> Also remember that if you ever add groups by manually editing active
> instead of using ctlinnd, those entries again will be missing.
Here's a toy to maintain the thing automagically, from news.daily or
something like that.
#! /usr/local/bin/perl
require 5;
use strict;
### Fix this up to match your site. ###
require "/news/sm/lib/innshellvars.pl" ;
my (%active, %times, $key);
open ACTIVE, "<$inn::active";
while (<ACTIVE>) {
chomp;
/^(\S+)/;
$active{$1} = "";
}
close ACTIVE;
if (! -f $inn::activetimes) {
open ACTTIMES, ">$inn::activetimes";
close ACTTIMES;
}
# load in times, de-dupe while we're at it
open ACTTIMES, "<$inn::activetimes"
or die("Can't open $inn::activetimes for reading - $!");
while (<ACTTIMES>) {
chomp;
/^(\S+)\s*(.*)$/;
$times{$1} = $2;
}
close ACTTIMES;
# Fill in any missing active.times entries
for (keys(%active)) {
$times{$_} = time() . " meow" if ! defined $times{$_};
}
rename($inn::activetimes, "$inn::activetimes.old")
or die("Can't rename $inn::activetimes to $inn::activetimes.old - $!");
# Write out the new active.times sorted by date
open ACTTIMES, ">$inn::activetimes"
or die("Can't open $inn::activetimes for writing - $!");
for $key (sort { $times{$a} <=> $times{$b} } keys %times) {
next if ! defined($active{$key}); # drop entries not in active.
print ACTTIMES $key , " ", $times{$key}, "\n";
}
close ACTTIMES;
Technical Details
Message-ID:
<Pine.F3tBF4.Ewu-100000@meowhost.meow.invalid>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mailReferences:
<3673271e.1014988@139.175.55.249> <phenix-111219980950336301@roxboro0-045.dyn.interpath.net> <74rcm1$i20@meow.invalid>Show Full Headers
Complete Article Headers
Message-ID: <Pine.F3tBF4.Ewu-100000@meowhost.meow.invalid> Subject: Re: Netscap 4.x as a News Reader.... Date: Fri, 11 Dec 1998 00:00:00 +0000 From: Fluffy <gerglery@usa.net> References: <3673271e.1014988@139.175.55.249> <phenix-111219980950336301@roxboro0-045.dyn.interpath.net> <74rcm1$i20@meow.invalid> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail X-Deja-AN: 421261013 X-Sender: fluffy@meowhost.meow.invalid Content-Type: TEXT/PLAIN; charset=US-ASCII X-Complaints-To: abuse@demon.net X-Mail2News-Path: news.demon.net!out2.ibm.net!meowhost.meow.invalid X-Trace: mail2news.demon.co.uk 913400614 mail2news:24897 mail2news mail2news.demon.co.uk Organization: meow Mime-Version: 1.0 Newsgroups: news.software.readers,news.software.nntp