File size: 1,720 Bytes
53cb2b6
71316ee
 
53cb2b6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71316ee
 
53cb2b6
 
 
 
 
71316ee
53cb2b6
 
 
71316ee
53cb2b6
 
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
from flask import Flask, redirect, render_template_string
import time

app = Flask(__name__)

# HTML template for the message page
message_template = """
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Redirecting...</title>
    <style>
        body {{
            font-family: Arial, sans-serif;
            text-align: center;
            margin-top: 100px;
        }}
        .message {{
            font-size: 24px;
            margin-bottom: 20px;
        }}
        .redirect-info {{
            font-size: 18px;
            color: #666;
        }}
        .link {{
            color: blue;
            text-decoration: underline;
            cursor: pointer;
        }}
    </style>
</head>
<body>
    <div class="message">{{ message }}</div>
    <div class="redirect-info">{{ redirect_info }}</div>
    <div class="link"><a href="{{ redirect_url }}" target="_blank">Click here</a> if not redirected.</div>
</body>
</html>
"""

@app.route('/')
def redirect_to_website():
    time.sleep(3)  # Delay in seconds before redirecting
    message = "Redirecting you to our new AI experience! If not please click the link"
    redirect_info = "You will be redirected shortly."
    redirect_url = "https://ogegadavis254-roasting-2-0.hf.space"
    # Render the HTML template with the message, redirect_info, and redirect_url
    return render_template_string(message_template, message=message, redirect_info=redirect_info, redirect_url=redirect_url)

@app.route('/redirect')
def perform_redirect():
    return redirect('https://ogegadavis254-roasting-2-0.hf.space')

if __name__ == '__main__':
    app.run(debug=True)