Last active
March 6, 2021 16:13
-
-
Save mzabriskie/bc92a218a7759306af53 to your computer and use it in GitHub Desktop.
Select random Meetup attendee
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
// Run this from your browser console on your meetup event page (http://www.meetup.com/AngularJS-Utah/events/183104032/) | |
(function () { | |
// Query document for attendees and select a random one | |
const list = document.querySelector('ul.attendees-list').children, | |
item = list[Math.floor(Math.random() * list.length)], | |
name = item ? item.querySelector('h4.text--bold').innerText : 'N/A'; | |
// Remove item so they can only be selected once | |
item && item.parentNode.removeChild(item); | |
// Return random attendee | |
return name; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This will not work on the new layout, you can will have to change to