list nostr events, like and repost from bash

dependencies:
https://github.com/0xtrr/nostr-tool
https://github.com/fiatjaf/noscl

usage:

./profile.sh <npub>

script:

1
2
3
4
privkarg="-p $(cat ~/.config/nostr/config.json | jq -r .privatekey)"
relaysarg=$(noscl relay | grep -oP "^wss://[^:]+" | while read r; do echo -n -r "$r "; done)
res=$(nostr-tool $relaysarg list-events -a $(key-convertr --to-hex $1) --timeout 5)
echo "$res" | jq -c '.[] | del(.tags)' | head -n 3 |jq -r '"== note " + .id + " ==\n" + (.content | gsub("\n";" ")) + "\n\n''like:\nnostr-tool '"$privkarg $relaysarg"'react -a " + .pubkey + " -e " + .id + " -r \"+\"\n\n''repost:\nnoscl publish nostr:$(key-convertr --kind note " + .id + ")\n"'
Edit

Pub: 01 Oct 2023 13:34 UTC

Edit: 01 Oct 2023 14:19 UTC

Views: 91