Shinoa Fores 死の灰 on Nostr: Mite be necrothreading here but here goes: ``` #!/bin/bash RED_BOLD='\033[1;31m' ...
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
```
Published at
2025-03-13 01:24:18Event JSON
{
"id": "41b13f0ad05f24f2144abcf3874880f5b71583547bff7d374bba93466b415f6a",
"pubkey": "4bc7982c4ee4078b2ada5340ae673f18d3b6a664b1f97e8d6799e6074cb5c39d",
"created_at": 1741829058,
"kind": 1,
"tags": [
[
"e",
"b64d5e2040626a6b9803a7a5dab5f2c19432020a81eeda0be40b6e6daaef0b6b",
"wss://bitcoiner.social/",
"root"
],
[
"p",
"f839fb6714598a7233d09dbd42af82cc9781d0faa57474f1841af90b5c930939"
],
[
"r",
"wss://nos.lol/"
],
[
"r",
"wss://relay.primal.net/"
]
],
"content": "Mite be necrothreading here but here goes:\n\n```\n#!/bin/bash\n\nRED_BOLD='\\033[1;31m'\nRESET='\\033[0m'\n\nnak req -q -k 1 wss://nos.lol --stream 2\u003e/dev/null | while read -r line; do\n\n pubkey=$(echo \"$line\" | jq -r '.pubkey')\n\n metadata=$(nak req -k 0 -a \"$pubkey\" wss://nos.lol 2\u003e/dev/null | head -n 1)\n\n username=$(echo \"$metadata\" | jq -r '.content | fromjson | .name // .display_name // \"'\"$pubkey\"'\"')\n \n time=$(echo \"$line\" | jq -r '.created_at | todate')\n content=$(echo \"$line\" | jq -r '.content')\n 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\"\ndone\n```",
"sig": "d6e5c6e340d048d3bfbac98237b5dfa9c609f739fbce730395b9dcac5cd4d05981566b6f32cde39cf786b201f77a939425a0a22d468b6a381b7bf85c492e4454"
}