* Run an existing news server (INN2 https://www.eyrie.org/~eagle/software/inn/), and add scripts around it, or:
* Make a small server that talks NNTP and does exactly what you need
I've been doing the latter a number of times (most recently on Feedbase https://feedbase.org/ where the NNTP-part is written in Perl, and I am working on and off on a server (in Haskell) to run a blog where NNTP is the primary interface for the author; not quite finished yet), Gmane/Gwene http://gwene.org/ does the former.
NNTP is a pretty simple protocol - an easy way to get going is to create a server that reads lines from a socket and replies when it recognizes something, connect an nntp-client and see what it sends and check the RFC for what is expected back, and then just go from there.