Last active
April 14, 2018 19:39
-
-
Save justinribeiro/b9fbb91f4e0f687ba1b6c82ed83f84fe to your computer and use it in GitHub Desktop.
Get a console list of your reserved schedule. Use as DevTools snippet. Because friends let friends know where they'll be at I/O (generally).
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
schedule = ''; | |
sections = document.querySelectorAll(".schedule__grid__content"); | |
sections.forEach(section => { | |
let time = ''; | |
try { | |
time = section.querySelector(".schedule__grid__time").textContent; | |
} catch(e) { | |
time = section.querySelector('.schedule__grid__date'); | |
if (time) { | |
schedule = `${schedule} | |
${time.textContent} | |
`; | |
} | |
return; | |
} | |
let reserved = section.querySelector(".reservation--reserved"); | |
if (reserved) { | |
let talk = reserved.closest(".schedule__grid__event"); | |
if (talk) { | |
let title = talk.querySelector('.schedule__grid__event__title a').textContent; | |
let stage = talk.querySelector('.schedule__grid__event__description').textContent; | |
schedule = `${schedule} ${time} - ${title}, ${stage} | |
`; | |
} | |
} else { | |
schedule = `${schedule} ${time} - No session / codelab reserved | |
`; | |
} | |
}); | |
console.log(schedule); |
Author
justinribeiro
commented
Apr 12, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment