Last active
July 13, 2020 21:58
-
-
Save cdrini/1ed9a3f2e3e19ec9bb0daa308ebc3edf to your computer and use it in GitHub Desktop.
Misc ia snippets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Run anywhere on dev.openlibrary.org in console | |
var edition_ocaids = ` | |
isbn_9780316253017 | |
olivertwist01dick | |
`.trim().split('\n').map(x => x.trim()) | |
var url = 'https://dev.openlibrary.org/search.json?' + new URLSearchParams({ | |
q: `ia:(${removed_ocaids.join(' OR ')})`, | |
fields: 'key,ia', | |
limit: removed_ocaids.length | |
}); | |
console.log(url); | |
var resp = await fetch(url).then(r => r.json()); | |
var all_work_ocaids = Array.from(new Set(resp.docs.flatMap(d => d.ia))); | |
all_work_ocaids |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment