Batch Reading and Filtering of News


I'm a keen reader of several Usenet newsgroups, including comp.lang.prolog, rec.puzzles, and comp.risks. However, I sometimes have problems since my work takes me to sites which only have e-mail connection with the Internet. Sometimes sites run news servers, but only receive a small number of regional groups.

batnews.c is my answer to these restrictions. It is a small C program which downloads all the unread news items for a given newsgroup into a single file. It then sends that file to a specified e-mail address. A friend at the University of Melbourne, Seng Wai Loke, has set up a UNIX crontab job (a periodically repeated task) which calls batnews twice a week to send comp.lang.prolog news to my address at Prince of Songkla University (PSU). (I then use e-mail forwarding to redirect the message to my particular location).

In the main article, I start by describing NNTP, the Network News Transfer Protocol, used by news servers and clients. batnews.c utilises a very simple subset of that protocol (only three commands in fact). batnews.c does not filter the newsgroup articles it reads, but I briefly outline how various types of filtering can be added. Two simple post-processing AWK scripts that I've found useful are lines.awk and subjects.awk. Finally, I list a few useful resources concerning NNTP, Usenet, and news filtering.


Back to Web Programming