-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
forks.sh
executable file
·61 lines (53 loc) · 1.06 KB
/
forks.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
#!/bin/bash
usage()
{
echo "
Usage: git nostr forks [options]
ex: git nostr forks --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 -g "p" "$PUBLICKEY"|
websocat $RELAY| jq -r '.[2].pubkey'|sort -u|grep -v null