mirror of
https://github.com/jb55/nostril.git
synced 2024-12-24 19:25:51 -05:00
add some handy script
Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
parent
19f90b4e22
commit
7a01bc0cf7
2
scripts/nostr-contact
Executable file
2
scripts/nostr-contact
Executable file
|
@ -0,0 +1,2 @@
|
|||
#!/usr/bin/env bash
|
||||
echo '["REQ","",{"kinds":[0],"authors":["'$1'"]}]'
|
29
scripts/nostr-post
Executable file
29
scripts/nostr-post
Executable 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
2
scripts/nostr-query
Executable file
|
@ -0,0 +1,2 @@
|
|||
#!/usr/bin/env bash
|
||||
websocat "$@" wss://nostr-pub.wellorder.net
|
3
scripts/nostr-relay-note
Executable file
3
scripts/nostr-relay-note
Executable file
|
@ -0,0 +1,3 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
jq -c '["EVENT",.]' | websocat wss://nostr-pub.wellorder.net
|
Loading…
Reference in New Issue
Block a user