🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
5 messages
5 total messages Started by R Lucas Fri, 05 Sep 2003 02:04
Retrieving article sizes
#66611
Author: R Lucas
Date: Fri, 05 Sep 2003 02:04
33 lines
1941 bytes
Hi,

I'm writing a script that connects to a NNTP server and collects data from 
article headers. I intend to use it for generating statistics.

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 doesn't work with the Diablo server I've been using for testing.  
This seems to be because the article numbers in the XRef header do not
match those in the overview database. I suspect this might be due to the 
reason given in section 6.5 of the Diablo FAQ at 
http://www.xs4all.nl/~scorpio/diablo/faq.html. 'HEAD articlenumber' and 
'HEAD <message-ID>' commands give XRef headers with different article 
numbers.

So, can anyone think of a way to retrieve an article's number from the
overview database instead of the XRef header? Or, indeed, any other method
of persuading the server to give me the article's size?

Sorry if I've missed something really obvious, but this has had me puzzled 
for a day and a half now.

Rayner
Re: Retrieving article sizes
#66614
Author: 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
Re: Retrieving article sizes
#66627
Author: R Lucas
Date: Sun, 07 Sep 2003 15:59
40 lines
2319 bytes
In the referenced article, jeff@litech.org (Jeffrey M. Vinocur) writes:
>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).

I didn't know that. What's the advantage of disabling it?

>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).

That does sound more elegant and useful than what I've been doing up to
now. I'd hoped that I wouldn't have to redesign my program completely, but
I think the longer-term advantages of your suggested method will outweigh
the short-term inconvenience of ditching my existing code.

Many thanks for your help.

Rayner
Re: Retrieving article sizes
#66628
Author: Jeffrey M. Vinocur
Date: Sun, 07 Sep 2003 16:22
18 lines
1746 bytes
In article <HKuprx.Cu5.B.amos@bath.ac.uk>, R Lucas <csmrl@bath.ac.uk> wrote:
>In the referenced article, jeff@litech.org (Jeffrey M. Vinocur) writes:
>
>>Forget about NEWNEWS (especially since it's disabled on some
>>servers).
>
>I didn't know that. What's the advantage of disabling it?

At one time, it was *extremely* expensive for INN to provide
NEWNEWS functionality, and so on any server with a significant
number of users, the admin would have to disable it to keep the
system from being overwhelmed.  It's somewhat improved now, but
you certainly can't count on NEWNEWS working, sadly.


-- 
Jeffrey M. Vinocur
jeff@litech.org
Re: Retrieving article sizes
#66629
Author: R Lucas
Date: Sun, 07 Sep 2003 17:21
19 lines
1835 bytes
In the referenced article, jeff@litech.org (Jeffrey M. Vinocur) writes:
>In article <HKuprx.Cu5.B.amos@bath.ac.uk>, R Lucas <csmrl@bath.ac.uk> wrote:
>>In the referenced article, jeff@litech.org (Jeffrey M. Vinocur) writes:
>>
>>>Forget about NEWNEWS (especially since it's disabled on some
>>>servers).
>>
>>I didn't know that. What's the advantage of disabling it?
>
>At one time, it was *extremely* expensive for INN to provide
>NEWNEWS functionality, and so on any server with a significant
>number of users, the admin would have to disable it to keep the
>system from being overwhelmed.  It's somewhat improved now, but
>you certainly can't count on NEWNEWS working, sadly.

Oh, I see. It seems I've been fortunate enough not to encounter this 
on the servers I've used. Thanks for the tip.

Rayner
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