Next: urlparse Prev: gopherlib Up: Internet and WWW Top: Top

11.6. Standard Module nntplib

This module defines the class NNTP which implements the client side of the NNTP protocol. It can be used to implement a news reader or poster, or automated news processors. For more information on NNTP (Network News Transfer Protocol), see Internet RFC 977.

Here are two small examples of how it can be used. To list some statistics about a newsgroup and print the subjects of the last 10 articles:

@small{

}

To post an article from a file (this assumes that the article has valid headers):

The module itself defines the following items:

NNTP (host[, port]) -- function of module nntplib
Return a new instance of the NNTP class, representing a connection to the NNTP server running on host host, listening at port port. The default port is 119.
error_reply -- exception of module nntplib
Exception raised when an unexpected reply is received from the server.
error_temp -- exception of module nntplib
Exception raised when an error code in the range 400--499 is received.
error_perm -- exception of module nntplib
Exception raised when an error code in the range 500--599 is received.
error_proto -- exception of module nntplib
Exception raised when a reply is received from the server that does not begin with a digit in the range 1--5.

Menu

NNTP Objects