Created
July 9, 2019 15:52
-
-
Save DSchau/1a7f3ebd7372408a4baaa7f462ff0314 to your computer and use it in GitHub Desktop.
Get all Plex User Emails
This file contains hidden or 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
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