What is Nostr?
Kind 35392
Author Public Key
npub1pgh3nhq6rpte9sasxah36luewy54azfjjekrj7f45hwa69z35fdqfdrs38
Published at
2023-10-23 22:32:56
Kind type
35392
Event JSON
{ "id": "7376b59ddac965a9fca670b37a07b20fe9c8e287b7d9a784eba30626cbd53923", "pubkey": "0a2f19dc1a185792c3b0376f1d7f9971295e8932966c397935a5dddd1451a25a", "created_at": 1698100376, "kind": 35392, "tags": [ [ "d", "broogle" ] ], "content": "\u003c!DOCTYPE html\u003e\n\u003chtml\u003e\n \u003chead\u003e\n \u003ctitle\u003eBroogle\u003c/title\u003e\n \u003cstyle\u003e\n body {\n text-align: center;\n }\n\n table {\n margin: auto;\n }\n \u003c/style\u003e\n \u003c/head\u003e\n \u003cbody\u003e\n \u003ch1\u003eBroogle\u003c/h1\u003e\n\n \u003cscript src=\"https://unpkg.com/nostr-tools/lib/nostr.bundle.js\"\u003e\u003c/script\u003e\n \u003cscript\u003e\n const relays = [\n \"wss://nos.lol\",\n \"wss://nostr.bitcoiner.social\",\n \"wss://nostr.mom\",\n \"wss://relay-jp.nostr.wirednet.jp\",\n \"wss://relay.damus.io\",\n \"wss://relay.nostr.bg\",\n \"wss://relay.nostr.band\",\n \"wss://r.hostr.cc\",\n ];\n\n const getKey = (event) =\u003e\n event.kind == 5392\n ? event.id\n : `35392:${event.pubkey}:${\n event.tags.find((tag) =\u003e tag[0] == \"d\")[1]\n }`;\n\n (async () =\u003e {\n const pool = new window.NostrTools.SimplePool();\n const events = await pool.list(relays, [\n {\n kinds: [5392, 35392],\n limit: 10,\n },\n ]);\n await pool.close(relays);\n\n const uniqueEvents = Object.values(\n events\n .sort((a, b) =\u003e a.created_at - b.created_at)\n .reduce(\n (acc, obj) =\u003e ({\n ...acc,\n [getKey(obj)]: obj,\n }),\n {}\n )\n ).sort((a, b) =\u003e b.created_at - a.created_at);\n\n uniqueEvents.slice(0, 10).forEach((event) =\u003e {\n const nip19 =\n event.kind == 5392\n ? window.NostrTools.nip19.neventEncode(event)\n : window.NostrTools.nip19.naddrEncode({\n pubkey: event.pubkey,\n kind: 35392,\n identifier: event.tags.find((tag) =\u003e tag[0] == \"d\")[1],\n });\n const title = event.content.match(/\u003ctitle[^\u003e]*\u003e([^\u003c]+)\u003c\\/title\u003e/)[1];\n\n const h2 = document.createElement(\"h2\");\n const a = document.createElement(\"a\");\n a.setAttribute(\"href\", `nostr:${nip19}`);\n a.appendChild(document.createTextNode(title));\n h2.appendChild(a);\n document.body.appendChild(h2);\n });\n })();\n \u003c/script\u003e\n \u003c/body\u003e\n\u003c/html\u003e\n", "sig": "ab18ce0cc6fb26f0965b4d3e69dd10b43b0fb5b1df1fb987565d9302e9081422d3f79466a7d2ef5e692983359419b5598fc3662ca3160fa34b10bad85d297e8e" }