# I am the Watcher. I am your guide through this vast new twtiverse.
# 
# Usage:
#     https://watcher.sour.is/api/plain/users              View list of users and latest twt date.
#     https://watcher.sour.is/api/plain/twt                View all twts.
#     https://watcher.sour.is/api/plain/mentions?uri=:uri  View all mentions for uri.
#     https://watcher.sour.is/api/plain/conv/:hash         View all twts for a conversation subject.
# 
# Options:
#     uri     Filter to show a specific users twts.
#     offset  Start index for quey.
#     limit   Count of items to return (going back in time).
# 
# twt range = 1 3
# self = https://watcher.sour.is/conv/ks74ctq
A Salty IM "Echo Bot" written in POSIX Shell:

h
#!/bin/sh
# A Salty IM Echo Bot written as a POSIX Shell script using salty-chat read'
# --post-hook mechanism.
#
# Setup:
#
# $ salty-chat -i ~/.config/salty/echobot.key -u echo@yourdomain.tld make-user
# $ salty-chat -i ~/.config/salty/echobot.key -u echo@yourdomain.tld read --post-hook ./echobot.sh

set -e

# XXX: Set this to the echobot's key
identity=

# XXX: Set this to the echobot's addr
user=

tmpfile="$(mktemp -t "echobot-XXXXXX")"
trap 'rm $tmpfile' EXIT

cat > "$tmpfile"

sender="$(head -n 1 < "$tmpfile" | awk '{ print $2 }')"
sender="$(echo "$sender" | sed 's/[)(]//g')"
message="$(head -n 1 < "$tmpfile" | awk '{ $1 = ""; $2 = ""; print $0; }')"

echo "$message" | salty-chat -d -i "$identity" -u "$user" send "$sender"


😅
A Salty IM "Echo Bot" written in POSIX Shell:

h
#!/bin/sh
# A Salty IM Echo Bot written as a POSIX Shell script using salty-chat read'
# --post-hook mechanism.
#
# Setup:
#
# $ salty-chat -i ~/.config/salty/echobot.key -u echo@yourdomain.tld make-user
# $ salty-chat -i ~/.config/salty/echobot.key -u echo@yourdomain.tld read --post-hook ./echobot.sh

set -e

# XXX: Set this to the echobot's key
identity=

# XXX: Set this to the echobot's addr
user=

tmpfile="$(mktemp -t "echobot-XXXXXX")"
trap 'rm $tmpfile' EXIT

cat > "$tmpfile"

sender="$(head -n 1 < "$tmpfile" | awk '{ print $2 }')"
sender="$(echo "$sender" | sed 's/[)(]//g')"
message="$(head -n 1 < "$tmpfile" | awk '{ $1 = ""; $2 = ""; print $0; }')"

echo "$message" | salty-chat -d -i "$identity" -u "$user" send "$sender"


😅
and..... bookmarked