newsgroup lib

J

Jesper Olsen

Is there a python module for accessing newsgroup articles?

Something similar to urllib for downloading web pages...

Cheers
Jesper
 
G

Gerrit Holl

Jesper said:
Is there a python module for accessing newsgroup articles?

You're looking for nntplib

http://www.python.org/dev/doc/devel/lib/module-nntplib.html

For example,
s = NNTP('news.cwi.nl')
resp, count, first, last, name = s.group('comp.lang.python')
print 'Group', name, 'has', count, 'articles, range', first, 'to',
last Group comp.lang.python has 59 articles, range 3742 to 3803
resp, subs = s.xhdr('subject', first + '-' + last)
for id, sub in subs[-10:]: print id, sub
....
3792 Re: Removing elements from a list while iterating...
3793 Re: Who likes Info files?
3794 Emacs and doc strings
3795 a few questions about the Mac implementation
3796 Re: executable python scripts
3797 Re: executable python scripts
3798 Re: a few questions about the Mac implementation
3799 Re: PROPOSAL: A Generic Python Object Interface for Python C
Modules
3802 Re: executable python scripts
3803 Re: \POSIX{} wait and SIGCHLD'205 news.cwi.nl closing connection. Goodbye.'

Gerrit.

--
5. If a judge try a case, reach a decision, and present his judgment in
writing; if later error shall appear in his decision, and it be through
his own fault, then he shall pay twelve times the fine set by him in the
case, and he shall be publicly removed from the judge's bench, and never
again shall he sit there to render judgement.
-- 1780 BC, Hammurabi, Code of Law
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top