newsgroup lib

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jesper Olsen

    newsgroup lib

    Is there a python module for accessing newsgroup articles?

    Something similar to urllib for downloading web pages...

    Cheers
    Jesper
  • deelan

    #2
    Re: newsgroup lib

    Jesper Olsen wrote:
    [color=blue]
    > Is there a python module for accessing newsgroup articles?
    >
    > Something similar to urllib for downloading web pages...[/color]
    nttplib?
    see: <http://www.python.org/doc/current/lib/module-nntplib.html>



    --
    email: goldicus1970 AT yahoo.it
    blog: http://www.deelan.com/




    Comment

    • Gerrit Holl

      #3
      Re: newsgroup lib

      Jesper Olsen wrote:[color=blue]
      > Is there a python module for accessing newsgroup articles?[/color]

      You're looking for nntplib



      For example,
      [color=blue][color=green][color=darkred]
      >>> s = NNTP('news.cwi. nl')
      >>> resp, count, first, last, name = s.group('comp.l ang.python')
      >>> print 'Group', name, 'has', count, 'articles, range', first, 'to',
      >>> last[/color][/color][/color]
      Group comp.lang.pytho n has 59 articles, range 3742 to 3803[color=blue][color=green][color=darkred]
      >>> resp, subs = s.xhdr('subject ', first + '-' + last)
      >>> for id, sub in subs[-10:]: print id, sub[/color][/color][/color]
      ....
      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[color=blue][color=green][color=darkred]
      >>> s.quit()[/color][/color][/color]
      '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
      --
      PrePEP: Builtin path type

      Asperger's Syndrome - a personal approach:


      Comment

      • Jesper Olsen

        #4
        Re: newsgroup lib

        Gerrit Holl <gerrit@nl.linu x.org> wrote in message news:<mailman.9 08.1075296595.1 2720.python-list@python.org >...[color=blue]
        > Jesper Olsen wrote:[color=green]
        > > Is there a python module for accessing newsgroup articles?[/color]
        >
        > You're looking for nntplib
        >
        > http://www.python.org/dev/doc/devel/...e-nntplib.html
        >[/color]

        Indeed so.
        Thanks Gerrit & deelan

        Jesper

        Comment

        Working...