🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #90305

Re: working with cnfs

#90305
From: Adam W.
Date: Mon, 17 Apr 2023 21:37
36 lines
2412 bytes
Nigel Reed <sysop@endofthelinebbs.com> wrote:

> 1. How can I search the entire spool for a given phrase.
> 
> 2. How can I search a given hierarchy recursively for a given phrase.

I don't have a direct answer (other than what Julien said), but if the 
search phrase is always the same, then you could add another newsfeeds 
entry and feed all new articles to the program with "Tp". This program 
(script) could do the grep and, for example, send you an email, or post 
to a private group, or whatever (~15 years ago I used to have a similar 
setup, reposting all replies to my posts to a private group, accessible 
only by me -- it was more convenient to reply to them this way).

Now I'm using it to count articles on Polish newsgroups to produce results 
like these:

http://news.chmurka.net/top15.php

The line is:

chmurka.postprocessor.pl\
        :!*,pl.*,alt.pl.*\
        :Tp:/usr/local/news/local/bin/post-processor-pl.sh %s

Now, as I think of it, it would be doable to do such grepping script by 
writing a program that reads the CNFS file (the format has to be described 
somewhere, or can be deduced from the source code) and maybe dumps its 
contents to stdout (or searches for a phrase and dumps the whole article), 
but I don't know of anything like that.

On the other hand, CNFS is a binary format, but posts are stored in a text 
format, so maybe something like this will suffice?

strings cnfs-file | grep phrase
grep -a phrase cnfs-file
Technical Details
Message-ID: <u1ke7c$634$1$arnold@news.chmurka.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail
References: <20230417103454.440dbdc0@wibble.sysadmininc.com>

Show Full Headers
Complete Article Headers
Message-ID: <u1ke7c$634$1$arnold@news.chmurka.net>
Subject: Re: working with cnfs
Date: Mon, 17 Apr 2023 21:37:49 +0000
From: gof-cut-this-news@cut-this-chmurka.net.invalid (Adam W.)
References: <20230417103454.440dbdc0@wibble.sysadmininc.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail
Newsgroups: news.software.nntp
Organization: news.chmurka.net
Nntp-Posting-Host: s.v.chmurka.net
Injection-Date: Mon, 17 Apr 2023 21:37:49 -0000 (UTC)
Injection-Info: news.chmurka.net; posting-account="arnold"; posting-host="s.v.chmurka.net:172.24.44.20"; logging-data="6244"; mail-complaints-to="abuse-news.(at).chmurka.net"
User-Agent: tin/2.6.1-20211226 ("Convalmore") (Linux/5.15.32-v7+ (armv7l))
Cancel-Lock: sha1:NrwzRf6ECRfNecL81KHvV6CmsFA=