🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #36171

Re: Example of Net::NNTP & xover?

#36171
From: Greg Bacon
Date: Wed, 24 Mar 1999 00:00
35 lines
2156 bytes
In article <brad-2403991700280001@brad.techos.skynet.be>,
	brad@shub-internet.org (Brad Knowles) writes:
:     I'm in the process of putting together another news debugging tool,
: and of course would prefer to make life easy for myself by using the
: Net::NNTP module.  However, the man page for the xover command is not
: exactly crystal clear (in particular, how I would parse the "reference to
: an array which contains the overview fields for that message"), and there
: appears to be a great dearth of any useful posts on this subject that I
: can find over on DejaNews.

my %oview_fmt;

my $nntp = Net::NNTP->new;
die "Failed to open NNTP connection\n" unless $nntp;

my $i = 0;
for ( @{ $nntp->overview_fmt } ) {
    $oview_fmt{$_} = $i++;
}

my $o = $nntp->xover("$begin-$end");
while (my($num,$head) = each %$o) {
    print "Article $num:\n",
              "From:       ", $head->[$oview_fmt{"From:"}],       "\n",
              "Subject:    ", $head->[$oview_fmt{"Subject:"}],    "\n",
              "Date:       ", $head->[$oview_fmt{"Date:"}],       "\n",
              "Message-ID: ", $head->[$oview_fmt{"Message-ID:"}], "\n\n";
}

Greg
-- 
Sam:  What'd you like, Normie? 
Norm: A reason to live. Gimmie another beer. 

Technical Details
Message-ID: <7db5hp$n9k$1@info2.uah.edu>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-comp.lang.perl.modules.mbox.zip!not-for-mail
References: <brad-2403991700280001@brad.techos.skynet.be>

Show Full Headers
Complete Article Headers
Message-ID: <7db5hp$n9k$1@info2.uah.edu>
Subject: Re: Example of Net::NNTP & xover?
Date: Wed, 24 Mar 1999 00:00:00 +0000
From: gbacon@itsc.uah.edu (Greg Bacon)
References: <brad-2403991700280001@brad.techos.skynet.be>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-comp.lang.perl.modules.mbox.zip!not-for-mail
X-Deja-AN: 458444151
Content-Type: text/plain; charset=us-ascii
X-Complaints-To: news@news.uah.edu
X-Trace: info2.uah.edu 922294649 23860 146.229.2.36 (24 Mar 1999 16:57:29 GMT)
Organization: The University of Alabama in Huntsville
Mime-Version: 1.0
Reply-To: Greg Bacon <gbacon@cs.uah.edu>
NNTP-Posting-Date: 24 Mar 1999 16:57:29 GMT
Newsgroups: news.software.nntp,comp.lang.perl.modules