This would print the latest 100 events:
echo '["REQ", "a", {"limit": 100} ]' | websocat wss://nostr-pub.wellorder.net
echo "[\"REQ\",\"latest\",{\"limit\": 100}]" |websocat wss://nostr-pub.wellorder.net |while read -r line; do jq -j ' "\n-------------\ntime : ", ( .[2].created_at | todate),"\nAuthor: ", (.[2].pubkey | .[0:6]),"\nPost : ", .[2].content, "\n" ' ; done
echo "[\"REQ\",\"latest_details\",{\"since\":$(date -d '-1 day' +%s),\"limit\": 100}]" | websocat wss://relay.damus.io |while read -r line; do jq -j ' "\n-------------\ntime : ", ( .[2].created_at | todate),"\nAuthor: ", (.[2].pubkey | .[0:6]),"\nPost : ", .[2].content, "\n" ' ; done
for server in "wss://relay.nostr.info" "wss://nostr-relay.wlvs.space" "wss://nostr-pub.wellorder.net" "wss://relay.damus.io" "wss://nostr.delo.software" "wss://nostr-pub.semisol.dev" "wss://nostr-relay-dev.wlvs.space" ; do req="[\"REQ\",\"l\",{\"ids\":[\"97c3680b533cf54ed67f3fcd291e934dcfbf72e4dadb8824a6f8f99c70061f5b\"]}]" ; echo $req $server ; echo "$req" | websocat -B 300000 $server ; done
To test how servers are working, get events for last 1 hour
for server in "wss://relay.nostr.info" "wss://nostr-relay.wlvs.space" "wss://nostr-pub.wellorder.net" "wss://relay.damus.io" "wss://nostr.delo.software" "wss://nostr-pub.semisol.dev" "wss://nostr-relay-dev.wlvs.space" ; do sinceSeconds=`date -d '-1 hour' +%s` ; req="[\"REQ\",\"l\",{\"since\":$sinceSeconds}]" ; echo $req $server ; echo "$req" | websocat -B 300000 $server | wc
To get events in multiple calls
unt=0; for server in "wss://relay.nostr.info" "wss://nostr-relay.wlvs.space" "wss://nostr-pub.wellorder.net" "wss://relay.damus.io" "wss://nostr.delo.software" "wss://nostr-pub.semisol.dev" "wss://nostr-relay-dev.wlvs.space" ; do echo $server ; for since in 6 12 18 24 ; do echo -$since -$unt ; sinceSeconds=`date -d "-$since hours" +%s` ; untilSeconds=`date -d "-$unt hours" +%s` ; req="[\"REQ\",\"l\",{\"since\":$sinceSeconds,\"until\":$untilSeconds}]" ; echo $req $server ; echo "$req" | websocat -B 300000 $server | wc ; unt=$since; done ; done
nostril --envelope --sec 0000000000000000000000000000000000000000000000000000000000000001 --created-at 1668869760 --content 'this'
Edited..