Created
April 16, 2021 04:44
-
-
Save walpolea/117b52f5b3fefd5cbde89ba293ba38f6 to your computer and use it in GitHub Desktop.
Paste this into your devtools console on your Disneyland ticket or reservation queue page to get better updates!
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
(function() { | |
const qUpdate = document.createElement("div") | |
qUpdate.classList.add(".queue-update"); | |
qUpdate.setAttribute('id', 'qUpdate'); | |
document.body.prepend(qUpdate); | |
qUpdate.innerHTML = `<div style="margin:20px;text-align:center;"><h1>Waiting for data to load...</h1></div>`; | |
var origOpen = XMLHttpRequest.prototype.open; | |
XMLHttpRequest.prototype.open = function() { | |
this.addEventListener('load', ()=>{ | |
const q = document.getElementById("qUpdate"); | |
const responseObject = JSON.parse(this.responseText); | |
const updateInterval = responseObject.updateInterval / 1000; | |
const { progress, expectedServiceTimeUTC, lastUpdatedUTC, queuePaused } = responseObject.ticket; | |
q.innerHTML = ` | |
<div style="margin:20px;text-align:center;"> | |
<h1>You are ${progress * 100}% through the line and the line is ${queuePaused ? 'not moving 😟' : 'moving! 😃'}</h1> | |
<h2>Estimated Service Time: ${new Date(expectedServiceTimeUTC)}</h2> | |
<h4>This should refresh every ${updateInterval} seconds, and last updated at: ${new Date(lastUpdatedUTC)}</h4> | |
</div>`; | |
}); | |
origOpen.apply(this, arguments); | |
}; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment