Skip to content

Instantly share code, notes, and snippets.

@DSchau
Created July 9, 2019 15:52
Show Gist options
  • Save DSchau/1a7f3ebd7372408a4baaa7f462ff0314 to your computer and use it in GitHub Desktop.
Save DSchau/1a7f3ebd7372408a4baaa7f462ff0314 to your computer and use it in GitHub Desktop.
Get all Plex User Emails
async function getAllUsers() {
const delay = duration => new Promise(resolve => setTimeout(resolve, duration))
const items = Array.from(document.querySelector('.friends-container').querySelectorAll('li'))
let emails = []
for (let el of items) {
if (el && el.querySelector('.edit-btn')) {
el.querySelector('.edit-btn').click()
await delay(1000)
const email = document.querySelector('.modal-dialog .text-muted').innerText
document.querySelector('.modal-dialog .close').click()
emails.push(email)
}
}
return emails
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment