summaryrefslogtreecommitdiff
path: root/tak
diff options
context:
space:
mode:
Diffstat (limited to 'tak')
-rwxr-xr-xtak13
1 files changed, 7 insertions, 6 deletions
diff --git a/tak b/tak
index 9121cdb..32371bf 100755
--- a/tak
+++ b/tak
@@ -1,10 +1,10 @@
#!/bin/bash
META="text/gemini; charset=utf-8"
-input="${QUERY_STRING//[^abcde12345CFW+-><]/}"
+input="${QUERY_STRING//[^abcde12345CFS+\-><]/}"
if [ -n "$input" ]; then
- new_ptn="${PATH_INFO//[^abcde12345CFW.+-LR]/}"
- new_ptn=$(echo ${new_ptn@Q} | tr 'LR' '<>')
+ new_ptn="${PATH_INFO//[^abcde12345CFS.+\-LR]/}"
+ new_ptn=$(echo $new_ptn | tr 'LR' '<>')
printf '20 %s\r\n' "$META"
printf '```\n'
while [ "$(pgrep geminict | wc -l)" > "10" ]; do
@@ -14,13 +14,14 @@ if [ -n "$input" ]; then
output=$(geminict ${attempt_ptn@Q})
if [ "$?" == "0" ]; then
ct1986=$(echo "$output" | awk '/ct1986 says:/ {print $3}')
- new_ptn="$attempt_ptn.$ct1986."
+ new_ptn="$attempt_ptn$ct1986."
fi;
+ new_ptn=${new_ptn//>/R}; new_ptn=${new_ptn//</L};
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/$(echo ${new_ptn@Q} | tr '<>' 'LR')/ Enter ply"
- echo 'Note: all input is stripped to match only [abcde12345CFW+-<>].'
+ echo "=> gemini://l-3.space/tak/$new_ptn/ Enter ply"
+ echo 'Note: all input is stripped to match only [abcde12345CFS+-<>].'
else
printf "10 Enter ply:\r\n"
fi;