Add scripts from 36C3

This commit is contained in:
s3lph 2020-01-07 23:06:16 +01:00
commit 43b805df1c
4 changed files with 85 additions and 0 deletions

17
printfefe.sh Executable file
View file

@ -0,0 +1,17 @@
#!/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

22
printtrump.sh Executable file
View file

@ -0,0 +1,22 @@
#!/bin/bash
#set -x
curl -s curl -s https://twitrss.me/twitter_user_to_rss/?user=potus | html2text | grep -v CDAT | grep -v ^1210 | 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 echo "${line}" | grep ']]>'
then
curl -sd "action=wrap&txt=########################" -H "Content-Type: application/x-www-form-urlencoded" -X POST http://tpaas.chaostreff.ch/
fi
if [ ${QUEUE} -ge 5 ]
then
echo "Queue full, sleeping...."
sleep 35
else
echo "Sending one line..."
sleep 0.5
fi
done

23
printtxt.sh Executable file
View file

@ -0,0 +1,23 @@
#!/bin/bash
#set -x
if [ -z "$1" ]
then
echo "Usage: $0 FILE"
exit 0
fi
cat $1 | while read line
do
echo "${line}"
QUEUE=$(curl -sd "action=cut&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

23
printwebsite.sh Executable file
View file

@ -0,0 +1,23 @@
#!/bin/bash
#set -x
if [ -z "$1" ]
then
echo "Usage: $0 URL"
exit 0
fi
curl -s $1 | 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