🐈⬛ on Nostr: You can get the online ones at the moment from clean up the list a bit and use ...
You can get the online ones at the moment from
https://api.nostr.watch/v1/online clean up the list a bit and use something like :
```
#!/bin/bash
input_file="cleaned_relays.txt"
output_file="relay_nips_output.txt"
specific_nip=45
> "$output_file"
while IFS= read -r relay; do echo "Querying $relay"
relay_name=$(echo "$relay" | awk -F[/:] '{print $4}')
response=$(curl -s --max-time 10 -H "Accept: application/nostr+json" "$relay")
nips=$(echo "$response" | jq '.supported_nips | @csv' | tr -d '"')
if echo "$nips" | grep -q "\b$specific_nip\b"; then echo "Supported NIPs for $relay_name ($relay): $nips"
echo "Relay Name: $relay_name" >> "$output_file" echo "Relay URL: $relay" >> "$output_file" echo "Supported NIPs: $nips" >> "$output_file" echo "" >> "$output_file"
fi done < "$input_file"
```
Takes awhile but will give you something like this:
Published at
2024-08-14 09:02:34Event JSON
{
"id": "0a68cd6e6ff00b6f6d2a715920038dad5478bb8f72e03092c5457fdac06e51a9",
"pubkey": "a514ab3befb752faaeb536192d04941dc25b88458e89407f9539bb89f39daf78",
"created_at": 1723626154,
"kind": 1,
"tags": [
[
"e",
"2649875b7a261e4872fbe46d96706bd6bbd8870725d2b3a3abfd40b1049646ef",
"",
"root"
],
[
"p",
"c21b1a6cdb247ccbd938dcb16b15a4fa382d00ffd7b12d5cbbad172a0cd4d170"
],
[
"r",
"https://api.nostr.watch/v1/online"
],
[
"r",
"https://image.nostr.build/03fb659b72c322044036c9838879451dc3c526fc07c55c9f1d0bf3e04706745b.jpg"
],
[
"imeta",
"url https://image.nostr.build/03fb659b72c322044036c9838879451dc3c526fc07c55c9f1d0bf3e04706745b.jpg",
"m image/jpeg",
"alt Verifiable file url",
"x 5d8d93a5ac3b1ee70f79587781a36f874f8efcddce0c2f327581b71ad2fca9ac",
"size 163259",
"dim 1079x1354",
"blurhash _86RM%~q%MRjRjj[ofayfQofj[ayWBj[ayayj[j[ayayj[j[j[ayayj[j[fQayfQj[j[ayayj[offQWBfQoffQayayfQj[j[fQayfQfQfQj[j[fQayfQj[j[j[WBWBofj[",
"ox 03fb659b72c322044036c9838879451dc3c526fc07c55c9f1d0bf3e04706745b"
]
],
"content": "You can get the online ones at the moment from https://api.nostr.watch/v1/online clean up the list a bit and use something like :\n\n```\n#!/bin/bash \n input_file=\"cleaned_relays.txt\" \n output_file=\"relay_nips_output.txt\" \n specific_nip=45 \n\n \u003e \"$output_file\" \n while IFS= read -r relay; do echo \"Querying $relay\" \n relay_name=$(echo \"$relay\" | awk -F[/:] '{print $4}') \n response=$(curl -s --max-time 10 -H \"Accept: application/nostr+json\" \"$relay\") \n nips=$(echo \"$response\" | jq '.supported_nips | @csv' | tr -d '\"') \n \n if echo \"$nips\" | grep -q \"\\b$specific_nip\\b\"; then echo \"Supported NIPs for $relay_name ($relay): $nips\" \n echo \"Relay Name: $relay_name\" \u003e\u003e \"$output_file\" echo \"Relay URL: $relay\" \u003e\u003e \"$output_file\" echo \"Supported NIPs: $nips\" \u003e\u003e \"$output_file\" echo \"\" \u003e\u003e \"$output_file\"\n fi done \u003c \"$input_file\"\n```\n\nTakes awhile but will give you something like this:\n https://image.nostr.build/03fb659b72c322044036c9838879451dc3c526fc07c55c9f1d0bf3e04706745b.jpg\n\n",
"sig": "3033fcd88fb082961e9a9c94db5966aaa254732edb0ad33d7641d28535216ecbe5a4aa57008dfe5f5769a88d4b85c3d477d8b710989596a95d266b1ac466e010"
}