The Nostr Event Deletion tool I posted a week ago now supports loading relays from your browser extension and kind 10002 events. The only catch is now you need to run it locally - as ported it to svelte, and I don’t know how to compile a single html file.

Full source code available for both versions. https://github.com/blakejakopovic/nostr_delete

Reply to this note

Please Login to reply.

Discussion

Here is the source code. The version #[1]​ linked is the standalone html with a couple less features. Works fine, but less assistance to load your relays from your browser extension or kind 10002 events.

#[2]

#[3]

Hey, I thought this tool was going to query relays for the user and try to find where the note was, not just ask us to select a bunch of relays. Am I confused?

The static URL is below.

The issue I had was when I wrote it in plain JavaScript was I needed a better UI template engine. Then I ported the code to Svelte to finish the relay import from extension and kind 10002 query across relays.

I then found out that Svelte is a real pain to export a single self-contained file (they love server side rendering apparently). Maybe someone can assist?

The GitHub repo version can be run locally and has those two features included. I don’t have a hosted version of the Svelte at present.

The logic at present is to rely on a bootstrap list, your browser extension relay data, and kind 10002 + any custom relays you wish to add - and broadcast the deletion to them. It doesn’t connect to relays first and ask which relays have that event - it just sends the deletion proactively to all loaded/selected relays.

If someone wanted it to blast deletion out to 100s of relays blindly, they can edit the bootstrap relay list in the code and it should work fine.

One limitation with the browser extensions is they can be very noisey with too. I made buttons for what could have been loaded (mostly) automatically, because at least with Nostore, it asks to read pubkey, then asks to read relays, and then asks to sign event. Lots of approval popups.

Everything can definitely be tweaked or improved. Things like private relays lists will need support

https://cdn.nostrgraph.net/public/delete.html

Svelte doesn't have anything to do with SSR. Maybe you used sveltekit or something weirder I don't understand. nostr:npub1jlrs53pkdfjnts29kveljul2sm0actt6n8dxrrzqcersttvcuv3qdjynqn may know.

You say you're using kind 10002, but I only see a static relay list, was that supposed to be updated?

It seems new svelte projects use the same new project commands. I was fairly sure I selected svelte (without kit) during creation - because I’d heard it isn’t amazing.

Basically the GitHub project is the latest code and the other delete.html isn’t updated as I haven’t worked out how to compile it statically without a web server yet. The second image is the GitHub version - with kind 10002 and extension relay loading options.

It looks like I can maybe use this adapter to output static site files? My previous attempts failed to find how to do it.

https://kit.svelte.dev/docs/adapter-static

To generate static files (SSG) with SvelteKit instead of SSR you can use the static adapter. https://github.com/sveltejs/kit/tree/master/packages/adapter-static

Thanks. I just got this working.

Do you know if there it a way to compile all the JavaScript output into a single file?

Popular tools include Webpack and Rollup for combining JavaScript files (with dependencies). Webpack is more for making websites, whereas Rollup is for making distributables for libraries.

May I ask, why not Vercel?

You mean instead of react?!

I don’t know, thought it would be better to have Mark with us.

I’m a big fan of individual a achievement, and for better or worse, Mark has achieved quite the world changing creations.

Not a need by any means since leaf and swift will do the trick, but you know, to be inclusive with the people of the world.

🫶🏻

https://nostr-delete.vercel.app

Hosted. I’m less up to date with PAAS providers, but I did sign up to vercel last week.

I did get the static site output working as well. GitHub updated.

CC @fiatjaf​

https://github.com/blakejakopovic/nostr_delete