What is the best way to determine what articles are available for a given usenet group?

StackOverflow https://stackoverflow.com/questions/15902444

  •  02-04-2022
  •  | 
  •  

Frage

I was wondering what the most efficient way is to get the available articles for a given nntp group. The method I have implemented works as follows:

(i) Select the group:

GROUP group.name.subname

(ii) Get a list of article numbers from the group (pushed back into a vector 'codes'):

LISTGROUP

(iii) Loop over codes and grab articles (e.g. headers)

for code in codes do
    HEAD code
end

However, this doesn't scale well with large groups with many article codes.

In RFC 3977, the GROUP command is indicated as also returning the 'low' and 'high' article numbers. For example,

[C] GROUP misc.test
[S] 211 1234 3000234 3002322 misc.test

where 3000234 and 2002322 are the low and high numbers. I'm therefore thinking of using these instead rather than initially pushing back all article codes. But can these numbers be relied upon? Is 3000234 definitely indicative of the first article id in the above-selected group and likewise is 3002322 definitely indicative of the last article id in the above-selected group or are they just estimates?

Many thanks,

Ben

War es hilfreich?

Lösung

It turns out I was thinking about this all wrong. All I need to do is

(i) set the group using GROUP

(ii) execute the NEXT command followed by HEAD for however many headers I want (up to count):

for c : count do
    articleId <-- NEXT
    HEAD articleID
end

EDIT: I'm sure there must be a better way but until anyone suggests otherwise I'll assume this way to be the most effective. Cheers.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top