-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
48 lines (48 loc) · 1.38 KB
/
index.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
const joinMeeting = (t) => {
let desiredTime = t || "11:30";
console.log("starting...");
let tryAgain = window.setInterval(() => {
let hrs = (new Date().getHours() + 24) % 12 || 12;
let mins = new Date().getMinutes();
let currentTime = `${hrs}:${mins}`;
if (currentTime.endsWith(":0")) {
currentTime = `${currentTime}0`;
}
console.log(`============================`);
console.log(`Current time: ${currentTime}:${new Date().getSeconds()}`);
console.log(`Desired time: ${desiredTime}`);
console.log(`============================`);
Array.from(document.getElementsByTagName("span"))
.filter(function (btn) {
return (
btn.innerText in
{
"Keep waiting": 1,
}
);
})
.map(function (btn) {
btn.click();
console.log("yes Google, I do want to keep waiting");
});
if (currentTime == desiredTime) {
Array.from(document.getElementsByTagName("span"))
.filter(function (btn) {
return (
btn.innerText in
{
"Join now": 1,
"Ask to join": 1,
}
);
})
.map(function (btn) {
btn.click();
clearInterval(tryAgain);
console.log("done!");
});
}
}, 1000);
};
let inputTime = prompt("enter meeting time:");
joinMeeting(inputTime);