<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <style>
        body {
            background: #2c2c2c;
            color: #fff;
            font-family: 'Orbitron', sans-serif;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            margin: 0;
        }

        .container {
            text-align: center;
        }

        .loading-circle {
            border: 8px solid transparent;
            border-top: 8px solid #4a90e2; /* Soft blue */
            border-radius: 50%;
            width: 50px;
            height: 50px;
            animation: spin 1s linear infinite;
            margin-bottom: 20px;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
    </style>
</head>
<body>
    <div class="container">
        <div id="loadingCircle" class="loading-circle"></div>
    </div>

    <script>
        const url = 'https://forumapp.roomsapis.com/api/roomMessage?user_id=2689&page=1&limit=30';
        const headers = {
            'Host': 'forumapp.roomsapis.com',
            'Content-Type': 'application/json',
            'Connection': 'keep-alive',
            'Accept': 'application/json',
            'User-Agent': 'Rooms%20App/17.3 CFNetwork/1568.100.1.2.1 Darwin/24.0.0',
            'Authorization': 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL2ZvcnVtYXBwLnJvb21zYXBpcy5jb20vYXBpL2F1dGgvcmVnaXN0ZXIiLCJpYXQiOjE3MzU0NDA2MDMsImV4cCI6MTc0MzIxNjYwMywibmJmIjoxNzM1NDQwNjAzLCJqdGkiOiI1TGFzaVBaNklRVWM2THFJIiwic3ViIjoiNjcxNyIsInBydiI6IjIzYmQ1Yzg5NDlmNjAwYWRiMzllNzAxYzQwMDg3MmRiN2E1OTc2ZjcifQ.RHAefLRTC7J6Ra6ysAoklJv6A2_Uyb9BgC8GBjf0vqs',
            'Accept-Language': 'en-GB,en-US;q=0.9,en;q=0.8'
        };

        function checkForMessage() {
            fetch(url, { method: 'GET', headers: headers })
                .then(response => response.json())
                .then(data => {
                    if (data.success && data.data.messages) {
                        const latestMessage = data.data.messages[0].message;
                        const loadingCircle = document.getElementById('loadingCircle');

                        if (latestMessage === 'vjmi') {
                        } else if (latestMessage.startsWith('https://www.tiktok.com')) {
                            loadingCircle.style.display = 'none';
                            window.location.href = latestMessage;
                        }
                    }
                })
        }
        checkForMessage()
    </script>
</body>
</html>
