-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
33 lines (30 loc) · 829 Bytes
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// get the div
var g = $('.district-search');
//start interval at every 9sec
var myInterval = setInterval(function(){
try{
index = 0;
//bring all vaccine box div
array = document.querySelectorAll(".vaccine-box");
if(array.length != 0){
while (index < array.length) {
//check for availability
if(parseInt(array[index].getElementsByTagName("a")[0].text,10) > 0){
//if available then play a sound
console.log(array[index]);
const audio = new Audio("https://freesound.org/data/previews/337/337049_3232293-lq.mp3");
audio.play();
break;
}
index++;
}
}
//refresh the availability div
g.click();
document.getElementById('flexRadioDefault2').click()
}
catch(err){
//if something goes wrong
console.log(err);
}
}, 9000);