Skip to content

Instantly share code, notes, and snippets.

@reyaz
Last active August 18, 2023 17:48
Show Gist options
  • Save reyaz/fdb95fc3f5b799ebb7d43690dc1dfcd4 to your computer and use it in GitHub Desktop.
Save reyaz/fdb95fc3f5b799ebb7d43690dc1dfcd4 to your computer and use it in GitHub Desktop.
Scryfall Utils
// Unique creature types (https://scryfall.com/search?as=text…)
//
// Store
//
var k = 'tmp_types', ls = localStorage, n = document.querySelectorAll('.card-text-type-line'), s = new Set(ls.getItem(k)?.split(',') || []); ls.setItem(k, [...[...n].reduce((a,c) => a.add(c.innerText), s)]);
//
// Copy
//
copy(localStorage.getItem('tmp_names').split(',').join('\n'))
// Unique names (https://scryfall.com/search?as=checklist…)
//
// Store
//
var k = 'tmp_names', ls = localStorage, n = document.querySelectorAll('[data-component="card-tooltip"] td:nth-of-type(3)'), s = new Set(ls.getItem(k)?.split(',') || []); ls.setItem(k, [...[...n].reduce((a,c) => a.add(c.innerText), s)]);
//
// Copy
//
copy(localStorage.getItem('tmp_names').split(',').join('\n'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment