Forked from jensenak/reinvent-2018-schedule-helper.js
Created
November 21, 2018 02:35
-
-
Save hunglethanh9/0b3b121681d9a47fb4ec097948d0ca1f 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.
This file contains hidden or 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
// 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