Thread View: news.software.readers
6 messages
6 total messages
Started by Grant Edwards
Tue, 16 May 2023 02:20
[slrn] post article from command line?
Author: Grant Edwards
Date: Tue, 16 May 2023 02:20
Date: Tue, 16 May 2023 02:20
10 lines
1046 bytes
1046 bytes
Is there a way to use slrn to post an article to an nntp server from the command line? If not, is there some other command-line utilty to do that? 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. :/
Re: [slrn] post article from command line?
Author: Ted Heise
Date: Tue, 16 May 2023 12:09
Date: Tue, 16 May 2023 12:09
73 lines
2435 bytes
2435 bytes
On Tue, 16 May 2023 02:20:21 -0000 (UTC),
Grant Edwards <invalid@invalid.invalid> wrote:
> Is there a way to use slrn to post an article to an nntp server from
> the command line?
>
> If not, is there some other command-line utilty to do that?
>
> 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.
>
> :/
This is the script I use on panix to periodically post an FAQ,
perhaps it could be helpful.
------- begin quote -----------------------
#!/usr/local/bin/perl5.22
use warnings;
use strict;
use Net::NNTP;
my $server_name="news.panix.com";
my @post=`cat FAQ/araa-FAQ-v1.16`;
my $Server = Net::NNTP->new($server_name, Reader => 1, Debug =>
0);
if (!$Server)
{
print " Can't connect to news! Not posted\n";
}
else
{
$Server->post();
my $ServerCod = $Server->code();
if ($ServerCod == 340)
{
$Server->datasend(@post);
$Server->dataend;
if (!$Server->ok())
{
my $ServerMsg = $Server->message();
$Server->quit();
print " Posting failed! Response from news server:\n" .
$Server->code() . " $ServerMsg\n";
}
else
{
print " Posted OK\n";
}
}
else
{
print " Post command not accept\n";
}
$Server->quit();
}
------- end quote -------------------------
I invoke it by a crontab entry. Can't recall where I got the
script in the first place, but I'm *sure* it wasn't written by me.
I probably just STFWd for it.
--
Ted Heise <theise@panix.com> West Lafayette, IN, USA
Re: [slrn] post article from command line?
Author: Urs JanΓen
Date: Tue, 16 May 2023 12:32
Date: Tue, 16 May 2023 12:32
7 lines
982 bytes
982 bytes
> If not, is there some other command-line utilty to do that? tinews uses perl Net::NNTP, <http://www.tin.org/bin/man.cgi?section=1&topic=tinews> <http://bzr.tin.org/tools/tinews.pl> <ftp://ftp.tin.org/pub/news/clients/tin/tools/tinews.pl>
Re: [slrn] post article from command line?
Author: Sam
Date: Tue, 16 May 2023 21:55
Date: Tue, 16 May 2023 21:55
17 lines
1352 bytes
1352 bytes
On Tue, 16 May 2023 02:20:21 -0000 (UTC), Grant Edwards <invalid@invalid.invalid> wrote: >Is there a way to use slrn to post an article to an nntp server from >the command line? > >If not, is there some other command-line utilty to do that? > >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. > >:/ You can create the message and use the slrnpull program to post it to a newsgroup.
Re: [slrn] post article from command line?
Author: Ivan Shmakov
Date: Fri, 19 May 2023 21:40
Date: Fri, 19 May 2023 21:40
24 lines
1608 bytes
1608 bytes
>>>>> On 2023-05-16, Grant Edwards wrote: > Is there a way to use slrn to post an article to an nntp server > from the command line? Aside of using the already suggested slrnpull(1)? None that I'd know of. > If not, is there some other command-line utilty to do that? > 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 a particular reason you can't use inews(1) proper? NNTP isn't /that/ sophisticated (or quickly evolving, FTM) a protocol, so maintaining the library would probably only take a modest effort. But aside of that, as other posters have already pointed, there's Net::NNTP for Perl, and AFAIK, it isn't going to be removed anytime soon. -- FSF associate member #7257 http://am-1.org/~ivan/
Re: [slrn] post article from command line?
Author: 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)
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads