Skip to content

Instantly share code, notes, and snippets.

View hennzen's full-sized avatar

Hennzen hennzen

  • Germany
View GitHub Profile
@hennzen
hennzen / idb-backup-and-restore.md
Created October 4, 2021 18:31 — forked from loilo/idb-backup-and-restore.md
Back up and restore an IndexedDB database

Back up and restore an IndexedDB database

This gist is an ES module which provides functions to import and export data from an IndexedDB database as JSON. It's based on Justin Emery's indexeddb-export-import package, but applies some adjustments that reflect better on the current browser landscape (i.e. better developer ergonomics but no support for Internet Explorer).

Usage

For each of the provided functionalities, you need a connected IDBDatabase instance.

Export Data

import { idb } from 'some-database'
@hennzen
hennzen / export-shazam-web.js
Last active January 21, 2023 14:40
Export Shazam list to JSON format
// JS-Console script to export song name, artist and cover image URL to a JSON format
// Order of results is in ascending date order. If you want to change that, delete line with '.reverse()'
// The result is copied to your clipboard
//
// 1. Open https://www.shazam.com/myshazam and login
// 2. Scroll down to the end of your list, so that *all* songs are loaded
// 3. Open Developer console with F12
// 4. Copy paste this code to the JS-console and hit Enter
// 5. Paste the result to your favorite text editor. Voilà.