From 0f652b2d99855c8270aa65d8772f7e340f96f73d Mon Sep 17 00:00:00 2001 From: tslil clingman <> Date: Tue, 5 Oct 2021 23:06:17 -0400 Subject: Reveal tak to the world! --- tak | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 tak (limited to 'tak') diff --git a/tak b/tak new file mode 100755 index 0000000..62ff252 --- /dev/null +++ b/tak @@ -0,0 +1,24 @@ +#!/bin/bash +META="text/gemini; charset=utf-8" + +input="${QUERY_STRING//[^abcde12345CFW]/}" +if [ -n "$input" ]; then + new_ptn="${PATH_INFO//[^abcde12345CFW.]/}" + printf '20 %s\r\n' "$META" + printf '```\n' + while [ "$(pgrep geminict | wc -l)" > "10" ]; do + sleep 0.25s; + done + output="$(geminict "$new_ptn$input.")" + if [ "$?" == "0" ]; then + ct1986=$(echo "$output" | awk '/ct1986 says:/ {print $3}') + new_ptn="$new_ptn$input.$ct1986." + fi; + printf '%s\n' "$output" + printf '```\n' + echo 'Please be patient, ct1986 is a slow bot and no more than 10 instances are allowed concurrently on the server.' + echo "=> gemini://l-3.space/tak/$new_ptn/ Enter ply" + echo 'Note: all input is stripped to match only [abcde12345CFW].' +else + printf "10 Enter ply:\r\n" +fi; -- cgit v1.3.1