Last active
January 26, 2021 22:59
-
-
Save bitmvr/bca0cacf471862f07f5c36ae99d90da3 to your computer and use it in GitHub Desktop.
getParticipantsFromGoogleMeet - Javascript to return a list of all users from a Google Meet Participants
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
let scrubParticipants = function(participant) { | |
if ( participant.includes('You') || participant.includes('Presentation')) { | |
participant = participant.replace('(You)',''); | |
participant = participant.replace('Presentation',''); | |
participant = participant.replace('\n',''); | |
} | |
return participant; | |
} | |
let getParticipants = async function(){ | |
let show_everyone = document.querySelectorAll('div[data-tooltip="Show everyone"]')[0]; | |
show_everyone.click(); | |
await new Promise(r => setTimeout(r, 2000)); | |
let list_of_participants = document.querySelectorAll('div[aria-label="Participants"] div[role="listitem"]'); | |
let participants = [...list_of_participants]; | |
participants = participants.map(participants => participants.innerText); | |
participants = participants.map(participants => scrubParticipants(participants)); | |
participants = new Set (participants); | |
participants = [...participants]; | |
let close_button = document.querySelectorAll('button[aria-label="Close"]')[0]; | |
close_button.click(); | |
return JSON.stringify(participants); | |
} | |
// To copy to your clipboard | |
copy(await getParticipants()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment