🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #51862

Re: Reading usenet archives

#51862
From: Rich Lafferty
Date: Mon, 16 Apr 2001 21:48
69 lines
3429 bytes
In news.software.nntp,
Yasir Hassan <no@spam.please> wrote:
> Sorry if this is the wrong place to ask.
> 
> I've downloaded an archive of a particular usenet group. The archive is
> simply a text file with all the postings and their headers.
> 
> Is there an app (on Windows, Mac or Linux, preferably windows) that can
> import the archive and let me view it in a user-friendly way (e.g. with
> messages threaded etc, as in something like Netscape of Outlook
> Express)?

There is now! Here's a short Perl program that'll convert a single
comp.lang.c++.moderated archive into an mbox-format mailbox, which any
Unix mailer -- and Netscape and Eudora but probably not Outlook -- can
read and thread. Some of the archive files don't have threading
information in them, though, so those will end up unthreaded in your
mailer (unless it supports subject threading in which case it'll be
naively threaded on Subject: instead of References:.)

If you find it useful, feel free to make it available to the rest of
comp.lang.c++.moderated; I haven't crossposted there because I've no
idea if this'd be acceptable for the group and don't want to wait to
see what the moderator thinks. :-)

Note that this was tested by looking at the existing archives; if they
decide to use a format which *isn't* a case of always separating
articles with the same header, then this will break (as it will on
the odd article which used the separating-header text in the body,
which didn't happen in any of the archives).

------8<----- cut here -----8<------
#!/usr/bin/perl -w
#
#  clcm2mbox -- convert comp.lang.c++.moderated archive into mbox mailbox
#
#  2001/04/16 Rich Lafferty <rich@bofh.concordia.ca>
#
#  Syntax: perl clpc2mbox archivename > mailboxname
#
#  Released into the public domain. NO WARRANTY.

use strict;
use vars qw($firstheader);

while (<>) {
    unless ($firstheader) {
	next if /^\s*$/;
	die "Input file is already in mbox format; doing nothing.\n"
	    if /^From /;
	$firstheader = (split(/:/, $_))[0];
    }
    print "From clcm2mbox\@localhost " . scalar localtime() . "\n"
	if /^$firstheader: /;

    print;
}
------8<----- cut here -----8<------

Hope this helps,

  -Rich

-- 
Rich Lafferty ----------------------------------------
 Nocturnal Aviation Division, IITS Computing Services
 Concordia University, Montreal, QC
rich@bofh.concordia.ca -------------------------------
Technical Details
Message-ID: <slrn9dmq64.48l.rich@bofh.concordia.ca>
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!supernews.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!ihug.co.nz!logbridge.uoregon.edu!hammer.uoregon.edu!newsflash.concordia.ca!not-for-mail
References: <MhMB6.2427$482.12589@newsfeeds.bigpond.com>

Show Full Headers
Complete Article Headers
Message-ID: <slrn9dmq64.48l.rich@bofh.concordia.ca>
Subject: Re: Reading usenet archives
Date: Mon, 16 Apr 2001 21:48:52 +0000
From: rich@bofh.concordia.ca (Rich Lafferty)
References: <MhMB6.2427$482.12589@newsfeeds.bigpond.com>
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!supernews.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!ihug.co.nz!logbridge.uoregon.edu!hammer.uoregon.edu!newsflash.concordia.ca!not-for-mail
Newsgroups: news.software.nntp
Organization: Concordia University, Montreal, Canada
Lines: 68
NNTP-Posting-Host: bofh.concordia.ca
Mail-Copies-To: never
X-No-Ahbou: yes
X-Grep-Bait: qmail, Kibo, Wollmann, meow, Archimedes Plutonium, Knights Templar
X-Disclaimer: I speak for myself.
X-PGP-Key: finger rich@alcor.concordia.ca
User-Agent: slrn/0.9.6.2 (Linux)