Last active
January 27, 2017 16:12
-
-
Save michaelsanford/f9f63dff45ee88683bf5d0fcdc97443f to your computer and use it in GitHub Desktop.
Will there be pizza? ππ½π
This file contains 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 strict"; | |
/** | |
* Attendees to JS-Montreal often don't know if there will be pizza or not. This aims to make it more clear. | |
* Traditionally, pizza is available if the meetup starts at 6 PM, but not if it starts at 7. | |
* | |
* @see https://www.meetup.com/js-montreal/ | |
*/ | |
const description = document.getElementById('event-description-wrap').innerText; | |
const time = document.getElementsByTagName('time')[0].getElementsByTagName('p')[0].innerText; | |
const pizza = document.createElement('span'); | |
document.getElementsByTagName('h1')[1].appendChild(pizza); | |
if (time.includes('6') || description.includes('will be pizza')) | |
pizza.innerText = "ππ½π"; | |
else if (time.includes('7') || description.includes('t be pizza')) | |
pizza.innerText="π«π"; | |
else | |
pizza.innerText = "π...π€·"; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Run this in the console on a JS-Montreal Meetup Upcoming Event page.
The event title will get a badge representing the pizza availability best-guess.
(It will only work on "upcoming" event pages, as past events have a different DOM structure for whatever reason.)
I'll make it a bit more clever and pack it as a Chrome Extension some snowy evening.