The response from NNTP.xover doesn't always match the format described in the documentation. It is supposed to return a (result, list) where the list contains entries of the format (article number, subject, poster, date, id, references, size, lines). However, I have found it to sometimes split the subject into two entries or only one of multiple references being in a list (see example below).
I am attempting to interpret the data using an enum-like structure to match the indices to the values but it fails very often because the date field contains part of the subject or the size field contains a cross reference entry.
Example using Python 2.7:
>>> import nntplib
>>> c = nntplib.NNTP(..)
>>> c.group('alt.binaries.linux')
('211 317334 3 317336 alt.binaries.linux', '317334', '3', '317336', 'alt.binaries.linux')
>>> resp, lst = c.xover('114179', '114179')
>>> print resp
224 data follows
>>> print lst
[('114179', 'Re: Newsposter - The Linux Binary Posting Script Version 7.2', 'Patriot <American1@shangri.la.org>', 'Mon, 04 Jan 2010 17:36:44 -0600', '<cu-dnfpXgcsR5t_WnZ2dnUVZ_rBi4p2d@giganews.com>', ['<5aydnT9obM20bKrWnZ2dnUVZ_v2dnZ2d@giganews.com>'], '<XGa0n.15891$0U1.11678@newsfe16.iad>', '1443')]
In the example above '<XGa0n.15891$0U1.11678@newsfe16.iad>' can be found at index 6 where the size is supposed to be.
|