add some handy script

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin 2022-04-23 07:52:41 -07:00
parent 19f90b4e22
commit 7a01bc0cf7
4 changed files with 36 additions and 0 deletions

2
scripts/nostr-contact Executable file
View File

@ -0,0 +1,2 @@
#!/usr/bin/env bash
echo '["REQ","",{"kinds":[0],"authors":["'$1'"]}]'

29
scripts/nostr-post Executable file
View File

@ -0,0 +1,29 @@
#!/usr/bin/env bash
set -e
TMP=$(mktemp)
$EDITOR "$TMP"
if [ ! -f "$TMP" ]; then
printf "could not create temporary file\n" >&2
exit 1
fi
content="$(cat $TMP)"
re="^[[:space:]]*$"
if [[ "$content" =~ $re ]]; then
printf "note empty. aborting.\n" >&2
exit 2
fi
note=$(nostril "$@" --content "$content")
printf "relaying:\n" >&2
printf "$note\n"
<<<"$note" nostr-relay-note
printf "done.\n" >&2
rm -f "$TMP"

2
scripts/nostr-query Executable file
View File

@ -0,0 +1,2 @@
#!/usr/bin/env bash
websocat "$@" wss://nostr-pub.wellorder.net

3
scripts/nostr-relay-note Executable file
View File

@ -0,0 +1,3 @@
#!/usr/bin/env bash
jq -c '["EVENT",.]' | websocat wss://nostr-pub.wellorder.net