-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
names.sh
executable file
·62 lines (54 loc) · 1.12 KB
/
names.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
usage()
{
echo "
Usage: git nostr names [options]
ex: git nostr names --publickey 0f578badfbc982c36aac5ca8ea973a0bea5ab93adaef9885e163fbe8d7e5e631 --relay ws://nostr.nostrin.gs
list other people's forks forks for a public key
# PUBLICKEY=`nostril --sec $SECRETKEY | jq --raw-output .pubkey`
Options:
--publickey nostr public key
--relay nostr relay url
"
exit 2
}
PUBLICKEY=""
RELAY=""
while [[ $# -gt 0 ]]
do
key="$1"
case $key in
-h | --help)
usage
;;
--publickey)
PUBLICKEY=$2
shift
shift
;;
--relay)
RELAY="$2"
shift
shift
;;
*)
PUBLICKEY="$1"
shift
;;
esac
done
if [ "$RELAY" = "" ]; then
RELAY=`git config nostr.relay`
fi
if [ "$RELAY" = "" ]; then
usage
fi
if [ "$PUBLICKEY" = "" ]; then
PUBLICKEY=`git config nostr.publickey`
fi
if [ "$PUBLICKEY" = "" ]; then
usage
fi
nostril query --kinds 7777|
websocat $RELAY|grep git-nostr-name|
jq -r '{event: .[2].id, name: .[2].content, pubkey: .[2].pubkey}' |jq -c|sort -u|grep -v null