-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin-bot.js
More file actions
34 lines (26 loc) · 946 Bytes
/
admin-bot.js
File metadata and controls
34 lines (26 loc) · 946 Bytes
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
import adminPassword from './server/admin-password.txt';
function sleep(time) {
return new Promise(resolve => {
setTimeout(resolve, time)
});
}
export default {
id: 'jokster',
name: 'jokster',
urlRegex: /^https:\/\/jokster\.tjc\.tf\//,
timeout: 10000,
handler: async (url, ctx) => {
const page = await ctx.newPage();
await page.goto('https://jokster.tjc.tf/login', { waitUntil: 'domcontentloaded' });
await sleep(1000);
const usernameInput = await page.$('#username');
await usernameInput.type('admin');
const passwordInput = await page.$('#password');
await passwordInput.type(adminPassword.trim());
const submitButton = await page.$('input[type="submit"]');
await submitButton.click();
await sleep(500);
await page.goto(url, { timeout: 3000, waitUntil: 'domcontentloaded' });
await sleep(3000);
}
};