Skip to content

Instantly share code, notes, and snippets.

@debiprasad
Last active November 8, 2022 18:52
Show Gist options
  • Save debiprasad/6a0fc2651f32f2b1f9b59a31a6bca15d to your computer and use it in GitHub Desktop.
Save debiprasad/6a0fc2651f32f2b1f9b59a31a6bca15d to your computer and use it in GitHub Desktop.
Bevy - JavaScript to count people on the waitlist

People on the waitlist (includes accepted/ticket released, excludes expired)

document.querySelectorAll('tr.list-item:not(.WaitListView-WaitListView-claimed-3kM9t):not(.WaitListView-WaitListView-expired-2IkU9)').length

People on the waitlist (excludes accepted/ticket released, excludes expired)

document.querySelectorAll('tr.list-item:not(.WaitListView-WaitListView-claimed-3kM9t):not(.WaitListView-WaitListView-expired-2IkU9)').length - document.querySelectorAll('.icon-hourglass-3').length

People RSVPed

All the people joined the waitlist earlier and now RSVPed after claiming their released ticket

document.querySelectorAll('tr.list-item.WaitListView-WaitListView-claimed-3kM9t').length

People to whom the ticket released (not claimed)

People for whom the ticket is released but they have not claimed it yet and there is still time for them to claim it

document.querySelectorAll('.icon-hourglass-3').length

People missed

People for whom the ticket was released but they did not claim it in time and the invitation is expired

document.querySelectorAll('tr.list-item.WaitListView-WaitListView-expired-2IkU9').length
@debiprasad
Copy link
Author

It's also possible to do more than counting.

For example, you want to see the people to whom the ticket is released but have not claimed it yet. It is difficult to find those manually when the list is too large. So, we can do the following to find those on the page.

Run the following JavaScript in the console.

document.querySelectorAll('.icon-hourglass-3')

It will show the NodeList. Open any node and click on it. It will show the node in the Elements tab. Then right-click on it and then click on "Scroll into view".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment