Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.misc > #681

Piping articles to Usenet: how-to

From RS Wood <rsw@therandymon.com>
Newsgroups comp.misc
Subject Piping articles to Usenet: how-to
Date 2014-02-21 20:54 +0000
Organization solani.org
Message-ID <le8eer$uel$2@solani.org> (permalink)

Show all headers | View raw


In an effort to make sure others can help send articles to comp.misc,
here's how I do it.  If this is useful to you, send us some stuff to
chat about!

My easy solution for scanning the news for interesting articles and
sending them easily to comp.misc involves three bits: newsbeuter as
console-based RSS reader, postnews.py (a python script that reads
a text file and posts it to a news server including user name and
password), and a little bash script that glues the two together.

Get newsbeuter for your *nix OS via the usual methods (or see
http://newsbeuter.org).  It's my favorite RSS reader, because it's for
the console, and you can pipe any article you see by pressing | either
in the article list or while reading the RSS article summary.  I know
it's available for Debian, openSUSE, and FreeBSD at a minimum.

Get postnews.py at http://sourceforge.net/projects/postnews/
It's a <10KB python script.

In between, I wrote a little bash script that accepts the standard input
(which would be the article contents coming from newsbeuter), asks a few
questions, puts it all together into a text file and sends that to
postnews.py.  Pretty simple stuff.  Better BASH scripters than me will
probably find dozens of ways to improve my work (I'd be interested in
knowing them, actually - a learning experience).  But this works pretty
well.  It allows me - while drinking my coffee - to scan the news, and
pipe anything I find relevant to comp.misc.  Fortunately, newsbeuter
does a good job of organizing all the links down at the bottom of the
post, which keeps the summaries readable.  Badda boom, badda bing.

If this is interesting, give it a try and help keep the conversation
(and the coffee) flowing!

---- post2compmisc.sh ----

#! /usr/local/bin/bash
TEMPTEXT='/tmp/slashtemptext'
TEMPHEADERS='/tmp/slashtempheaders'
TEMPARTICLE='/tmp/slashtemparticle'
DEPT=''
SUBJ=''

if [ -e $TEMPTEXT ];
then
	rm $TEMPTEXT 
fi 

if [ -e $TEMPHEADERS ];
then
	rm $TEMPHEADERS
fi 

if [ -e $TEMPARTICLE ];
then
	rm $TEMPARTICLE
fi 

while read line;
do
	echo "$line" >> $TEMPTEXT
done

echo ""
echo "This will go to comp.misc.  Enter Subject line:"
read SUBJ < /dev/tty

echo ""
echo "From which dept?"
read DEPT < /dev/tty

echo ""
echo "From: YOURNAME  <YOUR@EMAIL.ADDRESS.COM>" > $TEMPHEADERS
echo "Content-Type: text/plain; charset=UTF-8" >> $TEMPHEADERS
echo "" >> $TEMPHEADERS
echo "From the $DEPT department:" >> $TEMPHEADERS
cat $TEMPHEADERS $TEMPTEXT > $TEMPARTICLE
echo "----"
less $TEMPARTICLE

exec postnews --user LOGIN.NAME --pass YOURPASSWORD -f $TEMPARTICLE YOURNEWSSERVER

Back to comp.misc | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Piping articles to Usenet: how-to RS Wood <rsw@therandymon.com> - 2014-02-21 20:54 +0000
  Re: Piping articles to Usenet: how-to Mike Sanders <mike@taco-shack.cow> - 2014-02-22 00:09 +0000
  Re: Piping articles to Usenet  how-to "tdk" <forum.tdk@squte.com> - 2014-03-02 16:30 -0600
    Re: Piping articles to Usenet  how-to RS Wood <rsw@therandymon.com> - 2014-03-03 09:12 +0000
      Piping to comp.misc.  A revised script. RS Wood <rsw@therandymon.com> - 2014-03-03 20:44 +0000

csiph-web