Last active
March 27, 2022 04:45
-
-
Save moemoe89/8041ddf2526c3edce06ea9bf460fc3c4 to your computer and use it in GitHub Desktop.
random choose google meet participant
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
var exclude = [ | |
'(You)', | |
'Bismo Baruno' | |
] | |
function sleep(milliseconds) { | |
var start = new Date().getTime(); | |
for (var i = 0; i < 1e7; i++) { | |
if ((new Date().getTime() - start) > milliseconds) { | |
break; | |
} | |
} | |
} | |
for (i = 1; i <= 5; i++) { | |
sleep(1000); | |
console.log(i); | |
} | |
var participants = document.querySelectorAll('[aria-label="Participants"]')[0].innerText; | |
participants = participants.replace(/(\r\n|\n|\r)/gm, '<br />'); | |
for (var i = 0; i < exclude.length; i++) { | |
participants = participants.replace(exclude[i] + '<br />', ''); | |
} | |
var names = participants.split('<br />'); | |
var name = names[Math.floor(Math.random() * names.length)]; | |
console.log('The next presenter is ....'); | |
sleep(2); | |
console.log(name); | |
console.log('π π π π π π₯³ π₯³ ππ'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment