Article View: news.software.readers
Article #266050Re: [slrn] post article from command line?
From: Adam W.
Date: Sat, 20 May 2023 04:26
Date: Sat, 20 May 2023 04:26
32 lines
2070 bytes
2070 bytes
Grant Edwards <invalid@invalid.invalid> wrote:
> Python is removing NNTP support from the standard library, so my
> simple "inews" workalike is gong to stop working unless I start
> maintaining a Python NNTP implementation.
Is there any reason to not use rpost?
Here's one of my quick and dirty scripts:
#!/usr/bin/env python3
import os
import subprocess
dir = "/usr/local/news/spool/news-stat"
list = os.listdir(dir)
for entry in list:
if not entry.endswith(".to-be-posted"):
continue
pathname = dir + "/" + entry
basename = pathname.replace(".to-be-posted", "")
tmpname = basename + ".posting"
os.rename(pathname, tmpname)
p = subprocess.run("/usr/bin/rpost localhost -u -U (redacted) -P (redacted) -M < " + tmpname, shell=True)
if p.returncode != 0:
print("Command failed")
os.rename(tmpname, pathname)
else:
print("Command succeeded")
os.remove(tmpname)
Technical Details
Message-ID:
<u49i5j$i47$2$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-mailReferences:
<u3up95$47o$1@reader2.panix.com>Show Full Headers
Complete Article Headers
Message-ID: <u49i5j$i47$2$arnold@news.chmurka.net>
Subject: Re: [slrn] post article from command line?
Date: Sat, 20 May 2023 04:26:27 +0000
From: gof-cut-this-news@cut-this-chmurka.net.invalid (Adam W.)
References: <u3up95$47o$1@reader2.panix.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.readers
Organization: news.chmurka.net
Nntp-Posting-Host: s.v.chmurka.net
Injection-Date: Sat, 20 May 2023 04:26:27 -0000 (UTC)
Injection-Info: news.chmurka.net; posting-account="arnold"; posting-host="s.v.chmurka.net:172.24.44.20"; logging-data="18567"; 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:GNiiGxCEGIvgE2bCocalQXhWUys= sha1:87lg3JwczNwDNoNyTTxbgnr/A2c= sha256:hGIgIi50b9l4eBaVQijjsCPCuVZq9wQIVR/JKsX1fBw= sha1:XbeMHCemRyOXPfcr6kzbxp5EQfI= sha256:Cqr8xn15/6TXXquElxO2N3JY95eCTb0ZR3qKIuICugc=