stacker.news icon indicating copy to clipboard operation
stacker.news copied to clipboard

When a link to a nostr note is shared, extract noteid or nevent from url, and embed the note

Open huumn opened this issue 1 year ago • 6 comments

huumn avatar May 14 '24 14:05 huumn

For some reference I know that Primal uses noteId vs what appears to be the more standard nEvent so we would likely need to have at least 2 ways to recognize a nostr note

These two links lead to the same event https://primal.net/e/note1prrgyfue7xxaazapa3lg3p568tpd8883hnunta0ddvmu5ptljyhs2quhg8

https://snort.social/nevent1qqsq335zy7vlrrw73ws7cl5gs6dr4sknnncme7f47hkkkd72q4leztcpr9mhxue69uhhyetvv9ujuumwdae8gtnnda3kjctv9upzqpxfzhdwlm3cx9l6wdzyft8w8y9gy607tqgtyfq7tekaxs7lhmxfqvzqqqqqqyh0nfrc

Do you have any design ideas on how you might want the embed styled?

benalleng avatar May 14 '24 17:05 benalleng

It doesn't need to be too fancy. So, no no design ideas.

huumn avatar May 14 '24 18:05 huumn

Njump's website widget <script src="https://njump.me/embed/<nip-19-entity>" /> might be handy for this. It creates an embed from any NIP-19 entity.

sfr0xyz avatar May 15 '24 02:05 sfr0xyz

I'll check it out! I rolled my own from standard nostr-tools functions but I'll see if this is better for us

benalleng avatar May 15 '24 02:05 benalleng

Still have some stypling to do but WoW! image @sfr0xyz Definitely want to pay you half of this PR, I would have been working on this for ages had I not known about this njump embed!

benalleng avatar May 15 '24 15:05 benalleng

Looks great!

Thanks a lot! Very glad I could help.

sfr0xyz avatar May 15 '24 17:05 sfr0xyz