Skip to content

Instantly share code, notes, and snippets.

@jrswab
Created April 27, 2022 02:42
Show Gist options
  • Save jrswab/16ada907f90097b186bce156d6ce5864 to your computer and use it in GitHub Desktop.
Save jrswab/16ada907f90097b186bce156d6ce5864 to your computer and use it in GitHub Desktop.
Extract notes (not highlights) from `https://read.amazon.com/notebook`
// Loop over every "note" in the notebook
// Each book is it's own notebook.
// Highlights are considered notes at this level.
for(let i = 0; i < document.getElementsByClassName("kp-notebook-note").length; i++) {
// An id of 5 is a placeholder for when a user adds a note.
// Every note and highlight has at least this many characters in the ID.
if (notes[i].id.length > 5) {
console.log(notes[i].childNodes[1].innerHTML)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment