Global Feed Post Login
Replying to Avatar shinohai

Mite be necrothreading here but here goes:

```

#!/bin/bash

RED_BOLD='\033[1;31m'

RESET='\033[0m'

nak req -q -k 1 wss://nos.lol --stream 2>/dev/null | while read -r line; do

pubkey=$(echo "$line" | jq -r '.pubkey')

metadata=$(nak req -k 0 -a "$pubkey" wss://nos.lol 2>/dev/null | head -n 1)

username=$(echo "$metadata" | jq -r '.content | fromjson | .name // .display_name // "'"$pubkey"'"')

time=$(echo "$line" | jq -r '.created_at | todate')

content=$(echo "$line" | jq -r '.content')

printf "\n-------------\n${RED_BOLD}Time:${RESET} %s\n${RED_BOLD}PubKey:${RESET} %s\n${RED_BOLD}Username:${RESET} %s\n${RED_BOLD}Post:${RESET} %s\n" "$time" "$pubkey" "$username" "$content"

done

```

Avatar
⚡tephen 10mo ago

YEAH! That was it! Thank you so much!!

Reply to this note

Please Login to reply.

Discussion

Avatar
shinohai 10mo ago

Awesum, glad it worked for ya! 😎

bash/sed/awk + nak is truly the greatest nostr tool.

Thread collapsed