commit 43b805df1cb00ab418e49d49fd9d4c851dd1a855 Author: s3lph Date: Tue Jan 7 23:06:16 2020 +0100 Add scripts from 36C3 diff --git a/printfefe.sh b/printfefe.sh new file mode 100755 index 0000000..c53a8f8 --- /dev/null +++ b/printfefe.sh @@ -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 '
  • ' | wc -l) + if [ ${QUEUE} -ge 5 ] + then + echo "Queue full, sleeping...." + sleep 35 + else + echo "Sending one line..." + sleep 0.5 + fi +done diff --git a/printtrump.sh b/printtrump.sh new file mode 100755 index 0000000..f9ba280 --- /dev/null +++ b/printtrump.sh @@ -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 '
  • ' | 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 diff --git a/printtxt.sh b/printtxt.sh new file mode 100755 index 0000000..b5d08f0 --- /dev/null +++ b/printtxt.sh @@ -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 '
  • ' | wc -l) + if [ ${QUEUE} -ge 5 ] + then + echo "Queue full, sleeping...." + sleep 35 + else + echo "Sending one line..." + sleep 0.5 + fi +done diff --git a/printwebsite.sh b/printwebsite.sh new file mode 100755 index 0000000..c6550c0 --- /dev/null +++ b/printwebsite.sh @@ -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 '
  • ' | wc -l) + if [ ${QUEUE} -ge 5 ] + then + echo "Queue full, sleeping...." + sleep 35 + else + echo "Sending one line..." + sleep 0.5 + fi +done