-
-
Save yvenscolbert/977dbd37ceb26b453ae9 to your computer and use it in GitHub Desktop.
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
/* | |
Monitor ticket availability at Fifa.com Ticketing System site | |
Run this code at https://fwctickets.fifa.com/ticketingsystem.aspx?l=en#Tck2 | |
(use the console available in any browser developer inspector) | |
- configure the timeout between refreshes and the matches you want to monitor | |
- when any available ticket is found a beep sound is played and the refresh stops | |
*/ | |
function checkTicket() { | |
/* configure the timeout in miliseconds */ | |
var timeout = 3000; | |
/* configure the matches you want to monitor */ | |
var matches = ['62']; | |
/* beep url */ | |
var beepUrl = "https://www.proxy-service.de/proxy-service.php?u=http%3A%2F%2Fsoundbible.com%2Fmp3%2FMorse%2520Code-SoundBible.com-810471357.mp3&b=0&f=norefer"; | |
function isAvailable() { | |
for(var i =0; i < matches.length; i++) { | |
var match = matches[i]; | |
if ($('#IMT' + match + ' span[data-content~="badge"]').size() > 0) { | |
return true; | |
} | |
} | |
return false; | |
} | |
function playSound() { | |
var snd = new Audio(beepUrl); | |
snd.play(); | |
} | |
function check() { | |
if (isAvailable()) { | |
playSound(); | |
console.log('Some ticket is available!'); | |
} else { | |
checkTicket(); | |
} | |
} | |
nextValue = nextValue + (299-nextValue); | |
setTimeout(check, timeout); | |
} | |
checkTicket(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey, thanks for the code! It was working fine till today, but after this morning it stopped working. I tried to get it fixed but wasn't succesfull, would you mind taking a look?
Thanks!