Skip to content

Instantly share code, notes, and snippets.

@jensenak
Last active November 21, 2018 02:35
Show Gist options
  • Save jensenak/5ec3be368f23b0ada48b11b2f9eb5644 to your computer and use it in GitHub Desktop.
Save jensenak/5ec3be368f23b0ada48b11b2f9eb5644 to your computer and use it in GitHub Desktop.
Quick set of functions to make it easier to see what's available at re:Invent 2018. Intended for use from the browser console on the AWS re:Invent 2018 Event Catalog.
// Use the code below to simplify your re:Invent 2018 schedule search.
// Paste these into your browser console just once. They will remain in scope even after you change filters.
function openSchedules(elems) {
// As long as the list of elements is non-zero in length, expand the last element and call openSchedules with the rest.
if (elems.length) {
var el = elems.pop();
setTimeout(openSchedules, 200, elems); // You could shorten the timeout, but that probably isn't polite.
el.click();
} else {
// Once all of the elements have been clicked, hide any elements that cannot be added to your schedule.
[].slice.call(
document.getElementsByClassName('imageAddDisabled')
).forEach(function(el) {
el.parentElement.parentElement.parentElement.parentElement.style = "display: none;";
});
console.log("Done");
}
}
function keepGettingResults(n) {
if (n > 0) {
getMoreResults();
setTimeout(keepGettingResults, 2000, n-1);
} else {
console.log("Done");
}
}
// Run this to load all of the results on the page
keepGettingResults(parseInt(parseInt(document.getElementById('sessionSearchCount').textContent)/50));
// Run this to expand the schedules and hide events that are full.
// If you change any filters, just get all the results and run this again.
openSchedules([].slice.call(document.getElementsByClassName('expandSessionImg')));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment