Skip to content

Instantly share code, notes, and snippets.

@philiprenich
Last active July 8, 2019 22:28
Show Gist options
  • Save philiprenich/a0eb7553813934edb7164ad853634c4d to your computer and use it in GitHub Desktop.
Save philiprenich/a0eb7553813934edb7164ad853634c4d to your computer and use it in GitHub Desktop.
Export bookmarklet to export kobold.club encounters
javascript: var defaultEmail=""; var email=window.prompt("Email to send data to:", defaultEmail);var lib=JSON.stringify(localStorage.getItem('5em-library')); var party=JSON.stringify(localStorage.getItem('5em-party-info')); var players=JSON.stringify(localStorage.getItem('5em-players')); var body = "http://kobold.club/\n\nlocalStorage.setItem('5em-library', "+lib+");localStorage.setItem('5em-party-info', "+party+");localStorage.setItem('5em-players', "+players+");"; var link=document.createElement('a');link.setAttribute('href',"mailto:"+email+"?subject=Kobold%20Club%20export&body="+encodeURIComponent(body));var body=document.querySelector("body");body.appendChild(link);link.click();
@philiprenich
Copy link
Author

philiprenich commented Jul 8, 2019

Instructions

I'm going to assume you know a little bit about Javascript and web development for this.

Warning: This will overwrite any data stored with Kobold.club on the new browser

Usage

  1. Copy this entire Gist into a bookmarklet in your browser. Edit defaultEmail with your preferred email for quicker usage. Alternatively, set email to your email and remove the window.prompt function all together so your email client just launches immediately.
  2. Run the bookmarklet from http://kobold.club once you have your encounters set up. Email yourself the code.
  3. Copy the code from your email. Load up the developer tools in your other browser and paste the code into the console and run it. You may need to refresh the site - make sure you've loaded the home page so the rest of the data from Kobold can load as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment