🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
3 messages
3 total messages Started by Brad Knowles Wed, 24 Mar 1999 00:00
Example of Net::NNTP & xover?
#36154
Author: Brad Knowles
Date: Wed, 24 Mar 1999 00:00
23 lines
1602 bytes
Folks,

    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.

    I don't suppose you can give me any more explicit pointers, can you?


    Thanks!

-- 
Brad Knowles <brad@shub-internet.org> <http://www.shub-internet.org/brad/>
    <http://wwwkeys.pgp.net:11371/pks/lookup?op=get&search=0xE38CCEF1>

Are you looking for a news feed from a site in the Freenix Top 200?
If so, contact me via private e-mail for details.

Re: Example of Net::NNTP & xover?
#36166
Author: Dan Foster
Date: Wed, 24 Mar 1999 00:00
33 lines
2213 bytes
In article <brad-2403991700280001@brad.techos.skynet.be>,
Brad Knowles <brad@shub-internet.org> wrote:
>
>    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.

I haven't looked at that particular module in a while. I like/use
News::NNTPClient. For *that* one, it's as easy as:

$debug = 0;
$newsserver = "news.microsoft.com";
$newsport = 119;
$conn = new News::NNTPClient($newsserver, $newsport, $debug);
$stat = $conn->initialize;
$stat = $conn->mode_reader;
$overRange = $conn->group("alt.test");
@overviewRecords = $conn->xover($overRange);

Stuff like that. It's possible this is similiar for Net::NNTP's xover?
Don't remember where I got News::NNTPClient, but pretty sure off a CPAN site.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dan Foster
Systems Specialist, Frontier Internet Administration Team [East Coast]
Frontier GlobalCenter, Inc.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Re: Example of Net::NNTP & xover?
#36171
Author: 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. 

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