Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Select random Meetup attendee
// 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;
})();
@tylermcginnis

This comment has been minimized.

Copy link

tylermcginnis commented Jan 28, 2015

This really is the best. Thanks again, we use it every month.

@silentworks

This comment has been minimized.

Copy link

silentworks commented Dec 16, 2017

This will not work on the new layout, you can will have to change to

// Run this from your browser console on your meetup event page attendees list (https://www.meetup.com/AngularJS-Utah/events/dcspwhyskblb/attendees)
(function () {
    // Query document for attendees and select a random one
    var list = document.querySelector('.attendees-list').children,
        item = list[Math.floor(Math.random() * list.length)],
        name = item ? item.querySelector('h4.text--bold').innerHTML : '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
You can’t perform that action at this time.