There may have been easier ways to do that,
Honestly, your approach is probably the easiest -- at least until most clients store events and provide a "backup my events" button.
learned a little from it
That's always a good reason to write code for Nostr. We will need a lot more people working on Nostr to make it usable for the next billion users. And also to figure out what we can use Nostr for besides micro-blogging.