summaryrefslogtreecommitdiff
path: root/log-211006-1.gmi
diff options
context:
space:
mode:
authortslil clingman <>2021-10-05 23:06:17 -0400
committertslil clingman <>2021-10-05 23:06:17 -0400
commit0f652b2d99855c8270aa65d8772f7e340f96f73d (patch)
tree55924795772d1d353968f3be99c7ee5b7430d8cf /log-211006-1.gmi
parent7c4657c41c603307a7d6cf1293294f34eceea24f (diff)
Reveal tak to the world!
Diffstat (limited to 'log-211006-1.gmi')
-rw-r--r--log-211006-1.gmi42
1 files changed, 42 insertions, 0 deletions
diff --git a/log-211006-1.gmi b/log-211006-1.gmi
new file mode 100644
index 0000000..5849d6f
--- /dev/null
+++ b/log-211006-1.gmi
@@ -0,0 +1,42 @@
+Time-stamp: <2021-10-06 02h58 UTC>
+
+# Play Tak against a bot over Gemini!
+
+The title says it all! I had all the pieces lying about and so finally decided to put them together into a shoddy CGI script which calls my not-so-great bot on a game state. I'm excited to reveal what must surely be a Gemini first (only because the Tak player base is yet growing):
+
+=> gemini://l-3.space/tak.gmi The Tak portal
+
+At present i've attempted to limit the server to running 10 instances of the bot at once, but i'm not sure that that will work correctly. I'm also not sure i've defeated shell escapes here---please let me know⁰ how to improve on this! Here's the entire CGI script, all 24 lines of it.
+
+```CGI script for Tak
+#!/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;
+```
+
+Finally, while my capsule does compile to the web, this service is a Gemini exclusive :)
+
+--
+
+⁰ hello@l-3.space