🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #66614

Re: Retrieving article sizes

#66614
From: Jeffrey M. Vinocur
Date: Fri, 05 Sep 2003 04:04
30 lines
2227 bytes
In article <HKpxrF.Dy.B.amos@bath.ac.uk>, R Lucas <csmrl@bath.ac.uk> wrote:
>
>One other piece of information I'd like to collect is an article's size. 
>At the moment, I'm trying to do it like this:
>
>Connect to NNTP server
>Get a list of new message-IDs using NEWNEWS
>For each new message:
>    Get the headers using 'HEAD <message-ID>'
>    Get a group and article number pair from the XRef header
>    Go to the group with 'GROUP groupname'
>    Get the article's size using 'XOVER articlenumber'

This seems really complicated.  Can I suggest a different
approach entirely?

Forget about NEWNEWS (especially since it's disabled on some
servers).  Just keep track of the most recent article number
you've seen in each group.  Then your algorithm is simply to
enter each group in turn, and use XOVER n- (where n is one more
than the highest article you'd seen so far).  That will give you
the Message-ID and size for all the new articles in one fell
swoop, plus other useful information.  You can probably avoid
doing HEAD entirely (but if you need to, HEAD/NEXT/HEAD/NEXT is
pretty easy).


-- 
Jeffrey M. Vinocur
jeff@litech.org
Technical Details
Message-ID: <bj920d$pmv$3@puck.litech.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20140818.mbox.gz!news5.aus1.giganews.com!firehose2!nntp4!intern1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!in.100proofnews.com!in.100proofnews.com!cox.net!news-xfer.cox.net!news.litech.org!not-for-mail
References: <HKpxrF.Dy.B.amos@bath.ac.uk>

Show Full Headers
Complete Article Headers
Message-ID: <bj920d$pmv$3@puck.litech.org>
Subject: Re: Retrieving article sizes
Date: Fri, 05 Sep 2003 04:04:29 +0000
From: jeff@litech.org (Jeffrey M. Vinocur)
References: <HKpxrF.Dy.B.amos@bath.ac.uk>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20140818.mbox.gz!news5.aus1.giganews.com!firehose2!nntp4!intern1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!in.100proofnews.com!in.100proofnews.com!cox.net!news-xfer.cox.net!news.litech.org!not-for-mail
Newsgroups: news.software.nntp
Organization: Litech Systems Design
Lines: 30
Sender: jeff@litech.org
NNTP-Posting-Host: puck.litech.org
X-Trace: puck.litech.org 1062734669 26335 66.218.0.75 (5 Sep 2003 04:04:29 GMT)
X-Complaints-To: usenet@litech.org
NNTP-Posting-Date: Fri, 5 Sep 2003 04:04:29 +0000 (UTC)
X-Newsreader: trn 4.0-test76 (Apr 2, 2001)
Originator: jeff@litech.org (Jeffrey M. Vinocur)