🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #24664

Re: Text file to News/NNTP posting

#24664
From: Andrew Gierth
Date: Mon, 29 Dec 1997 00:00
43 lines
2075 bytes
>>>>> "Russ" == Russ Allbery <rra@stanford.edu> writes:

 > Steve Rawlinson <steve@clara.net> writes:
 >> Here's a script I use to post announcements which are piped to stdin.
 >> You'll need to change the header strings, obviously.

 Russ> Here's the same script, rewritten to use Net::NNTP:
 [snipped]

Alternatively:

#!/usr/bin/perl
use News::FormArticle;
my $date = <STDIN>;
my $subject = <STDIN>;
my @data = <STDIN>;
my $art = new News::FormArticle("article.tpl", sub { eval shift; });
die "failed to construct article" unless $art;
$art->post();

where article.tpl looks something like

From: ClaraNET Announce <announce@@clara.net>
Newsgroups: claranet.announce,claranet.systems
Followup-To: claranet.systems
Subject: $subject
Date: $date

@data

(you can put boilerplate text, sig or whatever in the template if you like)

News::FormArticle is part of News::Article, which is only alpha-ish
but in use in various places (including my own daily auto-posts to
news.admin.net-abuse.bulletins). Now available from
http://www.erlenstar.demon.co.uk/perl and shortly from CPAN. (Needs
Net::NNTP and a few other modules too.)

-- 
Andrew.

Technical Details
Message-ID: <87k9cnkjih.fsf@erlenstar.demon.co.uk>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail
References: <688jms$1lf$1@valkyrie.OnRamp.Net> <m3en2waxbs.fsf@windlord.Stanford.EDU> <34a7eb9f.536188790@eros.clara.net> <m3g1nc9dqd.fsf@windlord.Stanford.EDU>

Show Full Headers
Complete Article Headers
Message-ID: <87k9cnkjih.fsf@erlenstar.demon.co.uk>
Subject: Re: Text file to News/NNTP posting
Date: Mon, 29 Dec 1997 00:00:00 +0000
From: Andrew Gierth <andrew@erlenstar.demon.co.uk>
References: <688jms$1lf$1@valkyrie.OnRamp.Net> <m3en2waxbs.fsf@windlord.Stanford.EDU> <34a7eb9f.536188790@eros.clara.net> <m3g1nc9dqd.fsf@windlord.Stanford.EDU>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail
X-Deja-AN: 311116267
X-Mayan-Date: Long count = 12.19.4.14.7; tzolkin = 4 Manik; haab = 5 Kankin
X-Attribution: AG
X-Pgp-0x0E9FFBE9: 87 25 7F 14 41 24 B3 51 E0 19 8B DE 49 74 0C 29
X-NNTP-Posting-Host: erlenstar.demon.co.uk [194.222.144.22]
Organization: disorganised
Newsgroups: news.software.nntp