Why Nostr? What is Njump?
2023-12-30 12:40:00
in reply to

no_name on Nostr: real world example values quick draft: url: // previous example had this wrong let ...

real world example values
quick draft:

url:
https://npub1cjyu9wezc6flcjl673zvcd8my37zzv5e26p6kevjyfe9yuxczc6sll7r7x.hostr.cc/d/media.html#stablediffusion

// previous example had this wrong
let preview_instruction = await (await fetch("https://npub1cjyu9wezc6flcjl673zvcd8my37zzv5e26p6kevjyfe9yuxczc6sll7r7x.hostr.cc/d/preview_instruction.json";)).json()

{
response_key: "content",
...
}

using preview_instruction.json, we should get instruction to form this kind of query:

this.send(["REQ","q", {
"#t": ["stablediffusion"],
"limit": 3
}])

parse response:
let preview_img = JSON.parse(e.data)[preview_instruction.response_key])
Author Public Key
npub146y59dkatpwkx0ncs9u34vhmm60dedmdla0s8zy8yw22pqfj4huq36dp2y