nntplib retrieve news://FULL_URL

Nemesis nemesis at nowhere.invalid
Sat Apr 26 07:38:45 EDT 2008


James.Pells at gmail.com wrote:

> So I have established a connection to an nntp server and I am
> retrieving articles to other articles on the server such as
> news://newsclip.ap.org/D8L4MFAG0@news.ap.org
>
> Now I am wondering how I query for that article based off of the url?
>
> I assume D8L4MFAG0 is an id of some sort but when I try and retrieve
> that article via myNntpObject.article('D8L4MFAG0') I get an error of
> 423 Bad article number. Which makes sense as all the other article
> numbers are integers.

You should study a little bit NNTP RFCs ;-)
Anyway D8L4MFAG0 at news.ap.org could be the Message-ID of the article, a 'unique'
identifier associated to each article, while the Article Number is unique on
the server (but it changes on different servers).

the nntplib NNTP.article command can accept either Message-ID or Number as
argument, but if you want to use Message-ID you need to enclose it in brackets 
<>. 

So in your case this query should work:

myNntpObject.article('<D8L4MFAG0 at news.ap.org>')

Regards.
-- 
Love is an irresistible desire to be irresistibly desired.
 _  _                  _
| \| |___ _ __  ___ __(_)___
| .` / -_) '  \/ -_|_-< (_-<
|_|\_\___|_|_|_\___/__/_/__/ http://xpn.altervista.org




More information about the Python-list mailing list