<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Fetch and Execute HTML</title>
</head>
<body>
    <h1>Loading HTML from Pastefy...</h1>
    <div id="content"></div>

    <script>
        // URL of the Pastefy raw content
        const pastefyUrl = "https://pastefy.app/694JJCYs/raw";

        // Fetch the HTML content from the provided Pastefy link
        fetch(pastefyUrl)
            .then(response => response.text())
            .then(htmlContent => {
                // Inject the fetched HTML into the DOM
                document.getElementById('content').innerHTML = htmlContent;

                // Evaluate any scripts within the fetched content
                const scriptTags = document.querySelectorAll('#content script');
                scriptTags.forEach(script => {
                    const newScript = document.createElement('script');
                    newScript.textContent = script.textContent;
                    document.body.appendChild(newScript);
                });

                // Optionally, if you want to execute inline JavaScript too
                const inlineScripts = htmlContent.match(/<script[\s\S]*?>([\s\S]*?)<\/script>/g);
                if (inlineScripts) {
                    inlineScripts.forEach(script => {
                        const newScript = document.createElement('script');
                        newScript.textContent = script.replace(/<script[\s\S]*?>|<\/script>/g, '');
                        document.body.appendChild(newScript);
                    });
                }
            })
            .catch(err => {
                console.error('Error fetching content:', err);
            });
    </script>
</body>
</html>