-
Notifications
You must be signed in to change notification settings - Fork 0
/
menu1.html
51 lines (46 loc) · 1.95 KB
/
menu1.html
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
49
50
51
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://cdnjs.cloudflare.com/ajax/libs/axios/1.1.3/axios.min.js" integrity="sha512-0qU9M9jfqPw6FKkPafM3gy2CBAvUWnYVOfNPDYKVuRTel1PrciTj+a9P3loJB+j0QmN2Y0JYQmkBBS8W+mbezg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<title>NGL-Spam</title>
</head>
<body>
<h1 style="padding: 0; margin: 0;">NGL-Spam</h1>
<p style="margin: 0;">by Asada</p>
<div style="display: flex; margin-top: 30px;">
<p style="margin: 0;">Input target username:</p>
<input id="username" type="text" style="margin-left: 10px;" required>
</div>
<div style="display: flex; margin-top: 10px;">
<p style="margin: 0;">Input interval:</p>
<input id="interval" type="text" style="margin-left: 10px; width: 25px;" required>
<p style="margin: 0; margin-left: 5px;">seconds</p>
</div>
<button id="submit" style="margin: 15px;">Spam now!</button>
<div id="notify"></div>
<script>
let username = document.getElementById("username");
let interval = document.getElementById("interval");
let notify = document.getElementById("notify");
let submit = document.getElementById("submit");
submit.addEventListener("click", (e) => {
if(username.value === "") {
notify.innerHTML = "<p>Failed, username can't be empty</p>";
return;
} else if(isNaN(interval.value)) {
notify.innerHTML = "<p>Failed, interval must be a number</p>";
return
};
axios.post(`https://ngl-spam.asada.my.id:8000/api/random?username=${username.value}&interval=${interval.value}`).then((res) => {
console.log(res);
username.value = "";
interval.value = "";
notify.innerHTML = "<p>Success Spam!</p>";
});
});
</script>
</body>
</html>