🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #90298

Re: Encoding madness

#90298
From: Julien ÉLIE
Date: Sun, 16 Apr 2023 20:55
74 lines
3978 bytes
Hi Nigel,

> I'm trying to sync up the active and newsgroups file from 15 peers and
> it's proving to be a bit of a challenge.

Apart from encoding issues, are there special cases that you would have 
liked to achieve for your sync and merge?

We have 2 old scripts needing a bit of refresh.  I had planned to have a 
look at them for the INN 2.7.2 release (in late 2023 or 2024).
   https://github.com/InterNetNews/inn/issues/39


# mkngfile - make a newsgroup description file from multiple sources
#
# Jeremy Nixon <jeremy@exit109.com>
#  $Id: mkngfile,v 1.1 1999/04/17 09:19:25 jeremy Exp $
#
# This program creates a newsgroup description file, using one or
# several input files containing group descriptions.  The resulting
# file will contain a description line for each group in your active
# file.
#
# If the input contains multiple different descriptions for a group,
# the program will prompt interactively for which one to use; or, if
# the --noask option is given, one will be chosen arbitrarily.  If a
# group has no description, $default_desc (below) will be used.
#
# The output will be sent to stdout, or to the file specified with
# the --output (or -o) option.
#
# Example - to run with your existing newsgroups file, a local copy
# of the ISC newsgroups file, and a directory containing checkgroups
# files with names like *.check, creating the new file as 'newfile':
#  mkngfile -o newfile /news/etc/newsgroups newsgroups checkgroups/*.check
#
# You can set the location of your active file below so you don't
# have to specify it on the command line.


=> Besides files as input, I would also add the possibility to sync from 
hostnames (the program will then download their newsgroups files).

We'll also need a similar tool to merge several active files (note that 
INN already has the actmerge utility, without any documentation, that 
merges 2 active files).




Descriptions are then cleaned with:

# cleannewsgroups.pl
# Copyright 1997-1999 Arthur Hagen
# Remove duplicate (Moderated) comments
# Strip trailing spaces
# Keep only one description for a newsgroup
# Option to remove extra tabs or to pretty-print with several tabs
# Option to either sort the newsgroups file alphabetically or to have it
# in the same order as the active file.

It can warn when the encoding is not UTF-8 :-)


> The first bit is done, which is mainly getting rid of groups that have
> invalid names (those that end in a period, contain illegal characters,
> and the like).

Such checks can also be added to the script (with an option).

-- 
Julien ÉLIE

« Si, si, si… Avec des si, on mettrait Lutèce en amphore ! » (Vacancier)
Technical Details
Message-ID: <u1hnbm$1p02g$1@news.trigofacile.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
References: <20230411014437.0aef1026@wibble.sysadmininc.com>

Show Full Headers
Complete Article Headers
Message-ID: <u1hnbm$1p02g$1@news.trigofacile.com>
Subject: Re: Encoding madness
Date: Sun, 16 Apr 2023 22:55:18 +0200
From: Julien ÉLIE <iulius@nom-de-mon-site.com.invalid>
References: <20230411014437.0aef1026@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: Groupes francophones par TrigoFACILE
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 16 Apr 2023 20:55:18 -0000 (UTC)
Injection-Info: news.trigofacile.com; posting-account="julien"; posting-host="176.143-2-105.abo.bbox.fr:176.143.2.105"; logging-data="1867856"; mail-complaints-to="abuse@trigofacile.com"
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.10.0
Cancel-Lock: sha1:DzEUzRLXUUJh4CdWLFpsTWv23gc= sha256:wF6+yjjIvTU3pjbcveW5TfhcVjpMRoByhkcXTI+H/Yw= sha1:79MNSmwNshtjN7s3BTO5wx7kxZE= sha256:vmRcoZUWc/mkoyAYD3SAkEjJhbOuW8xFjTpL8DElR2k=
In-Reply-To: <20230411014437.0aef1026@wibble.sysadmininc.com>