Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
Niyaz5 authored Jul 15, 2024
1 parent ce970e9 commit 3fc9257
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -408,22 +408,23 @@ <h3>Password History</h3>
}

async function getIPInfo(ip) {
const response = await fetch(`https://ipwhois.app/json/${ip}`);
const response = await fetch(`https://ipapi.co/${ip}/json/`);
const data = await response.json();
return data;
}

async function displayIPInfo() {
const ip = await getIP();
const ipInfo = await getIPInfo(ip);
userIP = ip;

const ipInfoContainer = document.getElementById('ip-info');
const infoItems = [
{ label: `IP: ${ipInfo.ip}`, value: ipInfo.ip },
`City: ${ipInfo.city}`,
`Region: ${ipInfo.region}`,
`Country: ${ipInfo.country}`,
`ISP: ${ipInfo.isp}`
`Country: ${ipInfo.country_name}`,
`ISP: ${ipInfo.org}`
];

infoItems.forEach(item => {
Expand Down

0 comments on commit 3fc9257

Please sign in to comment.