[ANN] DejaGrabber 0.1 -- search Dejanews with Python

Duncan Booth duncan at rcp.co.uk
Mon Jun 28 10:44:31 CEST 1999


Neel Krishnaswami <neelk at alum.mit.edu> wrote in 
<7kuu73$1ki$1 at brick.cswv.com>:

>
>If you'd like a convenient way of searching the DejaNews archive using
>Python, I'm happy to present the DejaGrabber module. This is a module
>to make searching Dejanews easier. There are two classes, DejaGrabber
>and Article. I've tried to add a reasonable number of useful
>docstrings, too.
>
>Here's an example:
>>>> from DejaGrabber import *
>>>> d = DejaGrabber(group='comp.lang.python', author='Tim Peters')
>>>> l = d.get_messages(4)
>>>> print l
>[99/06/23  30 comp.lang.python          RE: Python Exes!      Tim Peters
>, 99/06/18  28 comp.lang.python RE: Newbie: Truth values (th      Tim 
Peters
>, 99/06/18  28 comp.lang.python       RE: DATE ARITHMETIC      Tim Peters
>, 99/06/18  28 comp.lang.python     RE: NameError Problem      Tim Peters
>, 99/05/18  25 comp.lang.python     RE: while (a=b()) ...      Tim Peters
>]
>

Nice bit of work. Two comments though:
Why does get_messages(4) return 5 messages? The doc string implies it 
should return only as many as its argument.

It would be useful if a test example was included in a "if 
__name__=='__main__'" block at the end of the file. At the very least the 
example you give above, but perhaps more usefully a full command line 
driven grabber.

-- 
Duncan Booth                                    duncan at dales.rmplc.co.uk
int month(char *p){return(124864/((p[0]+p[1]-p[2]&0x1f)+1)%12)["\5\x8\3"
"\6\7\xb\1\x9\xa\2\0\4"];} // Who said my code was obscure?
http://dales.rmplc.co.uk/Duncan




More information about the Python-list mailing list