Skip to content

Instantly share code, notes, and snippets.

@walpolea
Created April 16, 2021 04:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save walpolea/117b52f5b3fefd5cbde89ba293ba38f6 to your computer and use it in GitHub Desktop.
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!
(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