TIP: Click on subject to list as thread! ANSI
echo: taglines
to: Dan Richter
from: mark lewis
date: 2019-03-19 02:17:32
subject: Random Taglines

On 2019 Mar 18 17:25:58, you wrote to me:

 DR> I'll probably post 50 random taglines in each post. Gotta keep people
 DR> wanting more... :)

here's my posting script... it breaks the input file out into separate
files for posting... it is using hpt on this system to create the posts
from the individual files... the NUMLINES variable at the top is the number
of lines per file the input file will be broken into... as with the
previous script, it expects the input file's extension to be .txt...

this one is 59 lines long and i know that wordwrap will bite it fairly
hard... hopefully it won't be so bad it can't be fixed...

==== Begin "posttaglines"  ====
#! /bin/bash

NUMLINES=500

printf "\n"

printhelp() {
  printf "just tell me the tagline file to post (without extension)\n"
  printf "and the base file name of the parts to be posted.\n"
  printf "\n"
  printf "eg: posttaglines alltags.sorted.uniq foo\n"
  exit
}

case "$1" in
  ""       ) printf "ERROR: no tagline filename given.\n";
             printhelp;;
esac

case "$2" in
  ""       ) printf "ERROR: no base parts filename given.\n";
             printhelp;;
esac

if [ ! -e $1.txt ]
then
  printf "ERROR: file $1.txt not found.\n"
  printhelp
fi

if [[ -e $2aa ]]
then
  printf "Cleaning up previous $(ls -l $2* | wc -l | cut -d"
" -f1) $2* files\n"
  rm $2*
fi

printf "$(wc -l $1.txt | cut -d" " -f1) lines in $1.txt\n"
printf "splitting into files containing $NUMLINES lines each\n"
split -l $NUMLINES $1.txt $2
TOTALFILES=$(ls -l $2* | wc -l | cut -d" " -f1)
printf "$TOTALFILES $2* files to post\n"

COUNTER=0
for a in a b c d e f g h i j k l m n o p q r s t u v w x y z
do
  for b in a b c d e f g h i j k l m n o p q r s t u v w x y z
  do
    if [ ! -e $2$a$b ]
    then
      break
    fi
    ((COUNTER++))
    printf "posting file $COUNTER of $TOTALFILES - $2$a$b - $(wc -c
$2$a$b | cut -d" " -f1) bytes\n"
    printf "hpt post -nf \"mark lewis\" -af
\"1:3634/12.73\" -nt \"all\" -at
\"1:3634/12.73\" -s \"[AUTOPOST] Taglines $COUNTER of
$TOTALFILES (max $NUMLINES lines per post)\" -e \"taglines\"
-o \"\" -f loc $2$a$b\n"
    ~/fido/bin/hpt post -nf "mark lewis" -af
"1:3634/12.73" -nt "all" -at "1:3634/12.73"
-s "[AUTOPOST] Taglines $COUNTER of $TOTALFILES (max $NUMLINES lines
per post)" -e "taglines" -o "" -f loc $2$a$b
  done
done

printf "\n"
==== End "posttaglines" ====

)\/(ark

Always Mount a Scratch Monkey
Do you manage your own servers? If you are not running an IDS/IPS yer doin'
it wrong...
... Every person you meet knows something you don't. Learn.
---
* Origin: (1:3634/12.73)
SEEN-BY: 14/5 15/0 19/36 34/999 90/1 104/57 116/18 120/331 123/140 153/7715
SEEN-BY: 218/700 220/60 222/2 229/426 230/150 152 250/1 261/38 100 266/512
SEEN-BY: 267/155 275/100 282/1031 1056 291/1 111 320/119 219 340/400 342/13
SEEN-BY: 396/45 633/0 267 280 281 412 640/1384 712/620 848 886 770/1 801/189
SEEN-BY: 2320/105 3634/12 5020/1042
@PATH: 3634/12 261/38 712/848 633/280 267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.