-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeviceCheck.htm
More file actions
51 lines (50 loc) · 1.68 KB
/
Copy pathdeviceCheck.htm
File metadata and controls
51 lines (50 loc) · 1.68 KB
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
<html>
<body onload="submitData()">
</body>
<script>
function submitData()
{
var uagent = navigator.userAgent.toLowerCase();
if (uagent.search("iphone") > -1){
console.log("iPhone\nType: " + uagent)
scriptWebhook("iPhone", uagent)
}
else if (uagent.search("android") > -1){
console.log("Android\nType: " + uagent)
scriptWebhook("Android", uagent)
}
else if (uagent.search("windows") > -1){
console.log("Windows\nType: " + uagent)
scriptWebhook("Windows", uagent)
}
else{
console.log('Something Else Completely.\nType: ' + uagent);
scriptWebhook("I dunno Something Else Maybe?", uagent)
}
//Webhook Below
}
function scriptWebhook(agent, urgent){
var mdawebhook = new XMLHttpRequest();
mdawebhook.withCredentials = true;
mdawebhook.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
console.log("Webhook Sent!")
}
});
// Webhook Token Goes Here
mdawebhook.open("POST", "");
mdawebhook.setRequestHeader('Content-Type', 'application/json');
mdawebhook.send(
JSON.stringify({
//The Message Posted Here
content: `${agent}\nType:${urgent}`,
//The Username Of the Bot [Optional]
//username: mdaValue.user_name.value,
//The Avatar Of the Bot [Optional]
//avatar_url: mdaValue.user_pic.value,
})
);
}
</script>
</html>