-
-
Save Rovack/51e0fb558ee0fa4ce0e2cd5f0ab17cb1 to your computer and use it in GitHub Desktop.
// Note that this has some limitations, such as looking specifically for adult tickets, | |
// looking for the given days only in the nearest month that has availability, | |
// and always choosing the earliest time if several are found within the desired dates. | |
function setAdultTickets(adultTicketsWanted) { | |
const adultTicketsCount = parseInt($('.quantity-control.row > input')[0].value, 10); | |
const ticketChangeIterations = Math.abs(adultTicketsWanted - adultTicketsCount); | |
const ticketChangeButton = $(`.quantity-control.row > button.typcn-${adultTicketsCount < adultTicketsWanted ? 'plus' : 'minus'}`)[0]; | |
for (let i = 0; i < ticketChangeIterations; i++) { | |
ticketChangeButton.click(); | |
} | |
} | |
function playSound(src) { | |
return new Promise((resolve) => { | |
const audio = new Audio(src); | |
audio.onended = resolve; | |
audio.play(); | |
}); | |
} | |
function repeatHeyListen() { | |
playSound('https://www.myinstants.com/media/sounds/hey_listen.mp3') | |
.then(repeatHeyListen); | |
} | |
function waitForAvailability() { | |
return new Promise((resolve) => { | |
setTimeout(() => { | |
const availableEls = $('.calendar>.row:not(.blankLoader) .calendar-body .day.available'), isLoading = $('.calendar-modal[data-component=eventTimeModal] .modal-content > .loading-mask.hide').length === 0; | |
if (isLoading) { | |
return waitForAvailability() | |
.then((res) => resolve(res)); | |
} | |
resolve(availableEls); | |
}, 1000); | |
}); | |
} | |
function playSounds() { | |
playSound('https://www.myinstants.com/media/sounds/mlg-airhorn.mp3') | |
.then(() => playSound('https://www.myinstants.com/media/sounds/sound-9______.mp3')) | |
.then(() => playSound('https://www.myinstants.com/media/sounds/ps_1.mp3')) | |
.then(() => playSound('https://www.myinstants.com/media/sounds/wrong-answer-sound-effect.mp3')) | |
.then(() => playSound('https://www.myinstants.com/media/sounds/lalalalala.swf.mp3')) | |
.then(() => playSound('https://www.myinstants.com/media/sounds/tuturu_1.mp3')) | |
.then(() => playSound('https://www.myinstants.com/media/sounds/hallelujahshort.swf.mp3')) | |
.then(repeatHeyListen); | |
} | |
function addTicketsToBasket(dayElement) { | |
dayElement.click(); | |
setTimeout(() => waitForAvailability() | |
.then(() => { | |
$('.ui-control.button.select-time')[0].click(); | |
setTimeout(() => { | |
$('.typcn.typcn-shopping-cart.ng-binding')[0].click(); | |
}, 2000); | |
}), 2000); | |
} | |
function checkForTickets(datesWanted=[6, 7, 8], adultTicketsWanted=2, checkFrequency=15) { | |
setAdultTickets(adultTicketsWanted); | |
function check() { | |
$('.shared-calendar-button').click(); | |
waitForAvailability() | |
.then(availableEls => { | |
console.log(new Date(), 'Availability loaded. Checking for relevant dates...'); | |
for (let i = 0; i < availableEls.length; i++) { | |
const day = parseInt(availableEls[i].innerText, 10); | |
console.log('Day', day, 'is available...'); | |
if (datesWanted.includes(day)) { | |
console.log('Found tickets!!!!!'); | |
playSounds(); | |
addTicketsToBasket(availableEls[i]); | |
return; | |
} | |
} | |
console.log(`Relevant dates not yet available. Will check again in ${checkFrequency} seconds.`); | |
$('#page > div:nth-child(11) > div.modal.info-modal.w-auto-c > div > div.close').click(); | |
setTimeout(check, checkFrequency * 1000); | |
}); | |
}; | |
check(); | |
} |
I found this on your tripadvisor post. You rock!
I have this script running on my work PC during the week as well as my home PC on weekends. Thanks.
I want the dates July 12-16 but it keeps giving me September dates....how can I stop it giving me these?
@danielle1430 Sorry about that. As the 3rd caveat notes, currently the script just goes with whatever month opens by default, i.e. the nearest one that has availability. This just wasn't a problem in my case.
It shouldn't be too difficult to add month selection functionality though:
Once the date selection modal is open (that is, after line 74), you can get the currently selected month from $('[name="ctl00$ContentPlaceHolder$SalesChannelDetailControl$EventsDateTimeSelectorModal$EventsDateTimeSelector$CalendarSelector$MonthDropDownList"]')[0].value
(this gives the month number as a string, e.g. "9" for September).
You can then go to the previous month with $('[name="ctl00$ContentPlaceHolder$SalesChannelDetailControl$EventsDateTimeSelectorModal$EventsDateTimeSelector$CalendarSelector$PreviousMonthImageButton"]').click()
, or to the next one with $('[name="ctl00$ContentPlaceHolder$SalesChannelDetailControl$EventsDateTimeSelectorModal$EventsDateTimeSelector$CalendarSelector$NextMonthImageButton"]').click()
, as many times as you need.
Note that after every click, you should waitForAvailability
again, as the other month's availability may take a moment to load.
Once you have the month you want loaded, then the code starting at line 75 can run, looking for the specific days.
Since July 12-16 have already passed, I'm assuming this is no longer relevant for Danielle.
However, if anyone else encounters this issue, in case you're able to make these changes yourself, it'd be great if you could post the updated version.
If you don't feel like making the changes on your own, just leave me a comment. Hopefully this time I'll get the notification on time, and can help.
[Edit: You can now find working code that solves this case 2 comments down.]
Hi, your script is great, however, I am not that much of a programmer and I've got stuck.
I'm trying to get tickets for August 23-26, but they are only available for September.
Could you please help me to change Adult tickets to Family tickets and September to August?
Of course!
To look for Family tickets instead of Adult tickets, simply change the [0]
in lines 6 and 8 into a [3]
(for "Family (2 Adults + 2 Children)") or [4]
(for "Family (1 Adult + 3 Children)").
Remember: The default is 2 tickets, but if you want fewer/more, you can specify that when calling checkForTickets
(for example: checkForTickets([23,24,25,26], 1)
for just 1 ticket).
To look for tickets in August, add the following between lines 74 and 75 (that is, before for (let i = 0; i < availableEls.length; i++) {
):
const month = parseInt($('[name="ctl00$ContentPlaceHolder$SalesChannelDetailControl$EventsDateTimeSelectorModal$EventsDateTimeSelector$CalendarSelector$MonthDropDownList"]')[0].value, 10);
if (month !== 8) {
console.log(`Wrong month. Will check again in ${checkFrequency} seconds.`);
$('#page > div:nth-child(11) > div.modal.info-modal.w-auto-c > div > div.close').click();
setTimeout(check, checkFrequency * 1000);
return;
}
If you run into any problems, just let me know.
Edit: As @weqo points out in their comment from Nov 1, the structure of month values has changed, so this fix no longer works as-is.
The corrected version, as proposed by @weqo, is:
const monthValue = $('[name="ctl00$ContentPlaceHolder$SalesChannelDetailControl$EventsDateTimeSelectorModal$EventsDateTimeSelector$CalendarSelector$MonthDropDownList"]')[0].value;
const month = monthValue.replace(/^\D+/g, '');
if (month !== '8') {
console.log(`Wrong month. Will check again in ${checkFrequency} seconds.`);
$('#page > div:nth-child(11) > div.modal.info-modal.w-auto-c > div > div.close').click();
setTimeout(check, checkFrequency * 1000);
return;
}
Also note that I've made a minor one-line change, to fix a bug where sometimes the wrong day of the month would be selected, so make sure to use the current version.
@Rovack, thank you so much!
It seems to be working!
Got the tickets!
@Rovack, how can I buy you a beer? :)
Hahaha, no beer required. Just hearing the script helped you get the tickets has already made my day. 😄
Hello @Rovack, I'm looking for tickets for October 1 or 2, what would I need to change to do this? I see the instructions you left for the person looking for August tickets, but am not sure what to change to have it look for October. Thanks!
Hi @kramnnim,
August is month number 8 and October is 10,
so you should follow Rovack's instructions and just change 8 to 10 in this line:
if (month !== 8) {
It should look like this:
if (month !== 10) {
I hope this helps.
Thanks @DariusCS, I did try that, but it doesn't seem to work.
Maybe it's different since I'm wanting to skip over September's availabilities and you were wanting to check for August dates instead of skipping to September...?
Hi @kramnnim. You're correct that since you want to skip a month, rather than simply waiting for an earlier month to become available, that additional check won't be sufficient.
What you could instead do is add the following between lines 72 and 73 (that is, before .then(availableEls => {
):
.then(initialEls => {
const month = parseInt($('[name="ctl00$ContentPlaceHolder$SalesChannelDetailControl$EventsDateTimeSelectorModal$EventsDateTimeSelector$CalendarSelector$MonthDropDownList"]')[0].value, 10);
if (month === 9) {
console.log('Month too early - skipping to next month');
$('[name="ctl00$ContentPlaceHolder$SalesChannelDetailControl$EventsDateTimeSelectorModal$EventsDateTimeSelector$CalendarSelector$NextMonthImageButton"]').click();
return waitForAvailability();
} else {
return Promise.resolve(initialEls);
}
})
Just make sure to first re-copy the script, as I also made a small change to the "waitForAvailability" function which is needed for this to work.
(The check on the 3rd line, if (month === 9)
, is what will make it skip to the next month if the one that opens initially is September. This mechanism of course won't work for skipping 2 or more months, but finding tickets more than 1 month in advance shouldn't be very hard anyway.)
Edit: As @weqo points out in their comment from Nov 1, the structure of month values has changed, so this fix no longer works as-is.
The corrected version, as proposed by @weqo, is:
.then(initialEls => {
const monthValue = $('[name="ctl00$ContentPlaceHolder$SalesChannelDetailControl$EventsDateTimeSelectorModal$EventsDateTimeSelector$CalendarSelector$MonthDropDownList"]')[0].value;
const month = monthValue.replace(/^\D+/g, '');
if (month === '9') {
console.log('Month too early - skipping to next month');
$('[name="ctl00$ContentPlaceHolder$SalesChannelDetailControl$EventsDateTimeSelectorModal$EventsDateTimeSelector$CalendarSelector$NextMonthImageButton"]').click();
return waitForAvailability();
} else {
return Promise.resolve(initialEls);
}
})
@Rovack Thanks, that works! The alarm sounds will be hard to miss.
@kramnnim live saver right here, only took a few hours to get a reservation less than two weeks out! Thanks so much
@Rovack - sorry I'm a novice at this but my family (wife and 3 kids, who are Harry Potter lovers) desperately want to go to this. So, I'm trying my luck at running this script but nothing seems to come up - can you help me run this please?
I've changed it to the dates in October (22, 24, or 25) we want and tickets we need (4), my youngest is 4 so doesnt need a ticket - but I'm not having any luck :(
Any help will be much appreciated _/|_
Hey @mrrrr2, let's see if we can solve this!
So first, are the other 2 kids 5-15 years old? If so, it seems what you need is 1 family ticket, plus 1 (free) ticket for kids 4 and under.
Rather than adjust the script to work with 2 types of tickets, I'd suggest simply selecting the number of tickets manually when you open the page (before even doing anything with the script). You can replace line 67 with:
// setAdultTickets(adultTicketsWanted);
(that is, just adding //
at the start) to prevent the script from trying to automatically set the number of tickets for you.
Secondly, looking at the site right now, it seems there's little availability up to January. So, you probably want to tell the script you specifically want October tickets, to prevent it from getting tickets in Nov, Dec, or Jan in case they open up first.
To do so, you can follow the advice I gave DariusCS a while back, and add the following between lines 74 and 75:
const month = parseInt($('[name="ctl00$ContentPlaceHolder$SalesChannelDetailControl$EventsDateTimeSelectorModal$EventsDateTimeSelector$CalendarSelector$MonthDropDownList"]')[0].value, 10);
if (month !== 10) {
console.log(`Wrong month. Will check again in ${checkFrequency} seconds.`);
$('#page > div:nth-child(11) > div.modal.info-modal.w-auto-c > div > div.close').click();
setTimeout(check, checkFrequency * 1000);
return;
}
Once you make these 2 tweaks, just running checkForTickets([22, 24, 25])
should do the trick.
Before you even make these changes, though, what are you seeing when you just try to run the script as-is?
When I try, I see the availability calendar loading for a few seconds, and then I immediately start hearing the notification sounds and see the script go to the checkout page, as it finds tickets for the 22nd of January (this is before making the modifications I mentioned above to make it focus on October).
Does something different happen to you? When you paste the code, hit Enter, and then type checkForTickets([22, 24, 25])
, and hit Enter again, do you not see the availability dialog open up?
If not, please mention which browser and operating system you're using, and we'll try to figure out what's different.
(One point worth noting is that it seems the site's just generally running really slow at the moment. The spinning indicator that shows up when looking for tickets takes many seconds until you actually see the availability. Still, this shouldn't affect the script.)
Edit: As @weqo points out in their comment from Nov 1, the structure of month values has changed, so this fix no longer works as-is.
The corrected version, as proposed by @weqo, is:
const monthValue = $('[name="ctl00$ContentPlaceHolder$SalesChannelDetailControl$EventsDateTimeSelectorModal$EventsDateTimeSelector$CalendarSelector$MonthDropDownList"]')[0].value;
const month = monthValue.replace(/^\D+/g, '');
if (month !== '10') {
console.log(`Wrong month. Will check again in ${checkFrequency} seconds.`);
$('#page > div:nth-child(11) > div.modal.info-modal.w-auto-c > div > div.close').click();
setTimeout(check, checkFrequency * 1000);
return;
}
If it helps, here's a video showing what happens when I try running the script, without the modifications to make it focus on October and skip selecting the ticket types:
https://drive.google.com/file/d/13yiaKoFMk6WNLWBVDeP7pweD9EBrsWs-/view?usp=sharing
As you can see, the script immediately finds tickets (in January).
And here's one where I do make the modifications:
https://drive.google.com/file/d/1x8EZocOHCeugiCREhArmmoUPl7SFeV7V/view
Of course, in this one it doesn't immediately find tickets, but will keep trying from that point on.
If anything happens differently for you, just let me know at what stage and what exactly happens, so we can see what's going on.
@Rovack - I am speechless and in gratitude. No, we haven't got the tickets, but you've gone out of your way to not only help me, but hold my arm through the entire process, and even created videos to help me. Right now, the script is running, but nothing is coming up for the month you've helped us specify (October), so its running again every 15 seconds. I dont know how to thank you for getting us here, and I've seen you refuse money earlier (for beer), so I'm going to share this experience with my wife (wb studios the only thing she really, really wants to do in our visit to England) and kids, and hopefully they in turn will be uplifted and moved to help others, selflessly, as you have for us. I hope that wherever you are, if you take a deep breath, you'll feel the contentness and satisfaction of being in that light that you have helped create
Wow @mrrrr2, thank you so much for your kind words!! I can't tell you how wonderful that is to hear.
Mostly, I really really hope you do manage to get the tickets, and that you all get to go on the WB studios tour.
I'm honestly a bit shocked to see it's booked for 3 whole months in advance, but I guess that's the holidays for you... Still, there's a week left until those dates, and I've found it's often in the last week that some tickets go back on sale.
Hopefully if you leave the script running long enough, it'll find an opportune moment (as it originally did for me). :)
Let me know if you run into any other issues, or if there's anything else I can do to help, and either way - have an awesome vacation!
@Rovack - We got tickets!! What an amazing turn of fortune. An interesting thing happened - it was running and checking through and stopped going all the way to January, and stopped at Oct 21 (not a date that we had specified), but the time that it found would be workable, so we just basket'd them and checked out! Its on, we're on our way. I can't believe how helpful you have been in doing this, and the care that you had that we'll get to enjoy this family activity. Can't thank you enough - but I have a feeling good things have been coming to you and will continue to do so it's true that our prayers are heard (it is, we got tickets!!). Thank you sincerely _/|_
Any recommendations on where to start to learn this kind of coding -- i've been in finance my whole life but find this refreshing and extremely helpful - would love to learn more :)
So happy to hear the great news! Awesome to hear it all worked out. :)
The bit about the script picking the wrong day is a bit concerning. Wonder what could make it ignore the specified days...
I'll need to look into it.
As for how to learn, personally I think the best way to learn practical coding is just playing around with code and tweaking stuff. For instance, reading over scripts like this, trying to understand how they work, looking up any syntax or concepts you don't know, and modifying things as you see fit. If you have an idea for something you want to achieve programmatically, figuring out how to code it is the easy part.
Of course, at first you'll run into a ton of things you don't understand or have no idea how to do, but all answers can be found online (StackOverflow is a coder's most powerful tool), and you should never hesitate to just copy-paste wildly from answers and solutions you find online. After enough trial and error, you can make just about anything work, and over time it'll become increasingly fast and easy.
It does help to have some fundamental understanding of the language or frameworks you use, but that's super easy too nowadays; Googling e.g. "learn JavaScript" should turn up virtually infinite free and high-quality resources, and you can achieve quite a lot with very basic tools.
This script, as a very simple example, requires nothing more advanced than JavaScript, the jQuery library, and some understanding of HTML.
Of course, if you have the time to commit to it, the many coding Bootcamps that have been popping up in recent years can help a lot too, but hardly a requirement when starting out.
Anyway, I wish you and your family a magical time in the WB studios, and in your vacation in general!
@Rovack, I think the script found the nearest available date (21st) and saw that after looking forward for my date that none was available, so it kept looping and trying again. In my regular checks to see, I noticed that the date went from somewhere in January to October 21st so I clicked on the date to check times and saw that the time worked.
Thanks for the info, I look forward to learning JS and becoming a more active participant this digital age (as opposed to passive).
Still cant thank you enough though, but I dont want to belabor the point - you're basically an angel sent to help, and you touched us. Peace dear friend, always here if you need us
I'm currently looking to check December and there are available tickets in November. I added your edits from the Sept 7th post but noticed that it seems to be skipping the check. While troubleshooting, I noticed that parseInt($('[name="ctl00$ContentPlaceHolder$SalesChannelDetailControl$EventsDateTimeSelectorModal$EventsDateTimeSelector$CalendarSelector$MonthDropDownList"]')[0].value, 10)
returns NaN.
I do notice, however, that when I enter $('[name="ctl00$ContentPlaceHolder$SalesChannelDetailControl$EventsDateTimeSelectorModal$EventsDateTimeSelector$CalendarSelector$MonthDropDownList"]')[0].value
it does return string:11
for November.
After some google-fu I've modified the section (basically, perform a regex replace on the CTl100 month value so that it returns a string, and then match that string) so that month would match for November:
waitForAvailability()
.then(initialEls => {
const monthvalue = $('[name="ctl00$ContentPlaceHolder$SalesChannelDetailControl$EventsDateTimeSelectorModal$EventsDateTimeSelector$CalendarSelector$MonthDropDownList"]')[0].value;
const month = monthvalue.replace(/^\D+/g, "");
if (month === '11') {
console.log('Month too early - skipping to next month');
$('[name="ctl00$ContentPlaceHolder$SalesChannelDetailControl$EventsDateTimeSelectorModal$EventsDateTimeSelector$CalendarSelector$NextMonthImageButton"]').click();
return waitForAvailability();
} else {
return Promise.resolve(initialEls);
}
However, the script just seems to stop after logging "Month too early - skipping to next month" and doesn't continue on with the check. Any suggestions?
Ah, you're absolutely right. Looks like they changed the value structure from just the month number to "string:" followed by the number.
Your solution should definitely work. For simplicity, an alternative solution would be avoiding integer parsing and and regexes altogether, and just getting the name of the selected month, which is what's actually displayed (and therefore somewhat less likely to change in the future):
const month = $('[name="ctl00$ContentPlaceHolder$SalesChannelDetailControl$EventsDateTimeSelectorModal$EventsDateTimeSelector$CalendarSelector$MonthDropDownList"] > [selected="selected"]')[0].innerText;
if (month === 'November') {
Anyway, both this and your regex should be valid solutions, and neither is the cause for the script hanging, as you described and I also just verified.
The actual culprit for that one is a rare case that I hadn't handled: a month without a single day of availability (as is currently the case for December). Due to the way the script checks if the calendar has finished loading, failing to find a single day that's available will make it just keep waiting indefinitely.
Fortunately, there's a very simple solution for this, that requires nothing but removing code! Simply change the check in line 32 from:
if (availableEls.length === 0 || isLoading) {
to just:
if (isLoading) {
Honestly I'm not even sure why the availableEls.length
check existed in the first place. I think it might just be historical reasons (isLoading
was only added in a later version of the script IIRC).
I'll update this in the main snippet too, so in the future this edge case won't bother anyone else.
Thanks for pointing out these issues, and for taking the initiative to debug them on your own and share your solutions, @weqo!
Hope with this additional fix, the script works for you and you get the tickets you've been looking for. If you run into any other issues, of course do let me know. :)
P.S.: I've updated the original month-skipping comment to include your corrected version. Thanks again!
Hey, thanks so much for this. Can I just confirm that if I'm looking across months, I can just add the dates in the array consecutively? For example, if I'm looking for 27-31 December + 1 January, would the function be checkForTickets([27, 28, 29, 30, 31, 1], 2, 300)
?
@ReignOfComputer Sort of. If you enter those values, the script will search until it finds tickets on one of those days, in whichever month has the nearest available tickets.
So, as long as December has any tickets left, it'll keep waiting until one of the given days opens up in December. Even if January 1st actually does become available, the script won't detect this.
Conversely, if tickets for December run out entirely, such that the nearest availability is in January, the script might pick up tickets for e.g. January 27th.
In general, to specify which month you want, you could use one of the modifications mentioned in the comments above.
Specifically, you could make the change suggested on Sep 7 if you wanted to skip ahead of December to see if January 1st is available.
Or, the change suggested on Aug 14 if you only want to accept results in December so as to exclude results like January 27th.
However, actually making the script work with both months, associating different days for each, would not be quite so easy.
Fortunately, there is a simple solution you could try, that doesn't require any new code: Just open the site in 2 different tabs at the same time, and run the December search in one and January in the other.
The December tab would have the script version with the Aug 14 change, and you'd pass [27, 28, 29, 30, 31]
to checkForTickets
there, whereas the January tab would have the version with the Sep 7 change, and for that one you'd just pass [1]
.
This workaround is a bit cumbersome to be sure, but should work.
Let me know if any part of this is unclear, or if there's any other questions or issues.
Good luck!
How to use
checkForTickets([])
, putting the dates you want inside the brackets, separated by commas (and hit Enter). Optionally, specify the number of tickets you want (2 by default), and the frequency of checking (every 15 seconds by default). See Examples sectionAfter step 3, you should immediately start seeing the "Select a Date" window start popping up every few seconds. If it doesn't, just close the page and try following the steps again.
Should you want to make any changes to the dates or parameters you specified, just refresh the page and repeat steps 2-4. Similarly, to stop the script, just close or refresh the page.
I strongly recommend first running this script with dates you know are already available, just to test that it actually works and adds them to the basket, to avoid leaving it running for hours or days only to find out it wasn't working properly in the first place.
Examples
checkForTickets([10, 12])
- Get 2 adult tickets for the 10th or 12th (of the nearest month that has availability), checking every 15 secondscheckForTickets([10], 4)
- Get 4 adult tickets for the 10th (of the nearest month that has availability), checking every 15 secondscheckForTickets([10, 11, 12], 2, 3)
- Get 2 adult tickets for the 10th, 11th, or 12th (of the nearest month that has availability), checking every 3 secondsCaveats
[Update: You can find solutions for some of these in the comments below.]
$('[ng-if="packageItem.packageEventDate"] > .selected-date')[0].innerHTML
Most of these issues can be very easily tweaked by anyone with a basic knowledge of programming. Really, this script is meant to be more of a starting point than a finished product. It works well enough for the simple, specific case I had, but more importantly can be tweaked by anyone who has any different cases.
Update: Choosing a specific month
The 3rd caveat has turned out to be the most significant one, since more often than not it's incorrect to assume the month with the nearest availability is necessarily the right one, meaning it's important to be able to specify the month you want as well as the dates.
There are a lot of tweaks in the comments below for handling this in specific cases, but seeing as this is such a prevalent issue, there's now a new version of the script, which properly allows the user to select the month, without having to make any changes to the code.
Note, however, that this version hasn't been around as long, so it may have some bugs or issues that haven't yet been discovered.
If you want to try this version, use the code in the following comment, instead of the code above:
https://gist.github.com/Rovack/51e0fb558ee0fa4ce0e2cd5f0ab17cb1#gistcomment-3152015
Then, instead of
checkForTickets
, usecheckForTicketsInMonth
, which takes the month number as its 2nd argument.Examples
checkForTicketsInMonth([10, 12], 3)
- Get 2 adult tickets for the 10th or 12th of March, checking every 15 secondscheckForTicketsInMonth([10], 10, 4)
- Get 4 adult tickets for the 10th of October, checking every 15 secondscheckForTicketsInMonth([10, 11, 12], 10, 2, 3)
- Get 2 adult tickets for the 10th, 11th, or 12th of October, checking every 3 seconds(Note that this still doesn't allow selecting specific dates across different months. For that, the only current option is opening multiple browser tabs, and running the script with different parameters in each.)
Update: Extending session
Apparently the site now requires extending the session periodically.
See this comment by @Flame239 for the solution.
Update: Choosing specific hours
You can now also limit the selection to specific hours of the day, not just dates, by altering the code along the lines mentioned here.
Specifying different hours for diferent dates is not currently supported (though shouldn't be too difficult to implement).
Needless to say, the more limitations are placed, the less likely it is that tickets meeting all constraints will be available, so it's worth weighing how much flexibility you can afford.