tpaas-scripts/printfefe.sh

18 lines
534 B
Bash
Raw Normal View History

2020-01-07 23:06:16 +01:00
#!/bin/bash
#set -x
curl -s http://blog.fefe.de/?mon=201912 | html2text | sed -e 's/===============================================================================/===========================/' | while read line
do
echo "${line}"
QUEUE=$(curl -sd "action=wrap&txt=${line}" -H "Content-Type: application/x-www-form-urlencoded" -X POST http://tpaas.chaostreff.ch/ | grep '<li>' | wc -l)
if [ ${QUEUE} -ge 5 ]
then
echo "Queue full, sleeping...."
sleep 35
else
echo "Sending one line..."
sleep 0.5
fi
done