Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | RS Wood <rsw@therandymon.com> |
|---|---|
| Newsgroups | comp.misc |
| Subject | Re: Public Service Announcement |
| Date | 2014-09-12 11:31 +0000 |
| Message-ID | <20140912113142.c5b83a03.rsw@therandymon.com> (permalink) |
| References | <c7bifkFe8beU1@mid.individual.net> |
On 10 Sep 2014 18:09:57 GMT
RS Wood <rsw@therandymon.com> wrote:
> I use the newsbeuter RSS reader plus a small, custom bash script to post
> articles from an RSS feed to this newsgroup. You can find it at the
> wiki if you're interested. The script handles posting to either
> comp.misc or misc.news.internet.discuss, adds [CM] to any article cross
> posted to another group, and sets the followup to that group when cross
> posting.
Follow-up: I realize the script isn't easy to find on that wiki.
While I fix that, let me just post it here, for the record and in hopes
it's useful. All you need to do is download postnews (a 10 line python
script) and put it in your $BIN directory. Run newsbeuter to read your
RSS feeds, and pipe any article you want to post by hitting the pipe
key and sending it to this script, which will call postnews at the end
to do the actual NNTP work. Contact me if you have questions - the
above email works.
#! /usr/local/bin/bash
TEMPTEXT='/tmp/slashtemptext'
TEMPHEADERS='/tmp/slashtempheaders'
TEMPARTICLE='/tmp/slashtemparticle'
DEPT=''
SUBJ=''
XPOST=''
GROOP=''
POSTIT=''
for i in $TEMPTEXT $TEMPHEADERS $TEMPARTICLE
do
echo "Nuking $i"
if [ -e $i ]; then rm $i; fi
done
while read line;
do
echo "$line" >> $TEMPTEXT
done
echo "From: YOURNAME HERE <YOUR@EMAIL.COM>" > $TEMPHEADERS
echo "Content-Type: text/plain; charset=UTF-8" >> $TEMPHEADERS
echo ""
echo "This is a comp.misc/misc.news.int.discuss post. Enter Subject line:"
read SUBJ < /dev/tty
echo ""
echo "Send to comp.misc or misc.news.internet.discuss?"
echo "[C] comp.misc [M] m.n.i.d."
read SENDTO < /dev/tty
case $SENDTO in
[cC]) GROOP='comp.misc' ;;
[mM]) GROOP='misc.news.internet.discuss' ;;
esac
echo ""
echo "Crosspost? Type one additional group or ENTER for none."
echo "Follow-up will also be set: eg. misc.rabid.bunnies,comp.obnoxious.troll"
read XPOST < /dev/tty
if [ "$XPOST" != "" ];
then
SUBJ="[CM] ${SUBJ}"
GROOP="$GROOP,$XPOST"
echo "Subject: $SUBJ" >> $TEMPHEADERS
echo "Followup-To: $XPOST" >> $TEMPHEADERS
else
echo "Subject: $SUBJ" >> $TEMPHEADERS
fi
echo "Newsgroups: $GROOP" >> $TEMPHEADERS
echo ""
echo "From which dept? (eg. Happy go Lucky). I'll add the quotes."
echo "From which dept? (eg. Happy go Lucky). I'll add the quotes."
read DEPT < /dev/tty
echo "" >> $TEMPHEADERS
echo "From the «$DEPT» department:" >> $TEMPHEADERS
cat $TEMPHEADERS $TEMPTEXT > $TEMPARTICLE
echo "----"
head -20 $TEMPARTICLE
echo "Post it? (only 'y' will post)"
read POSTIT < /dev/tty
if [ "$POSTIT" = "y" ];
then
exec ~/bin/postnews \
--user MYUSERNAME \
--pass MYPASSWORD \
-f $TEMPARTICLE news.solani.org
else echo "Not posted."
fi
Back to comp.misc | Previous | Next — Previous in thread | Find similar | Unroll thread
Public Service Announcement RS Wood <rsw@therandymon.com> - 2014-09-10 18:09 +0000 Re: Public Service Announcement RS Wood <rsw@therandymon.com> - 2014-09-12 11:31 +0000
csiph-web