Spaces:
Runtime error
Runtime error
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Random Topic Recommendation</title> | |
<style> | |
body { | |
display: flex; | |
justify-content: center; | |
align-items: center; | |
height: 100vh; | |
font-family: Arial, sans-serif; | |
} | |
h1 { | |
font-size: 2em; | |
color: #333; | |
} | |
</style> | |
</head> | |
<body> | |
<h1 id="topic">์ฃผ์ ๊ฐ ์ฌ๊ธฐ์ ํ์๋ฉ๋๋ค</h1> | |
<script> | |
// ์ฃผ์ ์ ๋ฐ์ดํธ ํจ์ | |
function updateTopic() { | |
fetch('/get_topic') | |
.then(response => response.json()) | |
.then(data => { | |
document.getElementById('topic').textContent = data.topic; | |
}) | |
.catch(error => console.error('Error fetching topic:', error)); | |
} | |
// ํ์ด์ง๊ฐ ๋ก๋๋ ๋ ์ฃผ์ ์ ๋ฐ์ดํธ | |
updateTopic(); | |
// 20์ด๋ง๋ค ์ฃผ์ ์ ๋ฐ์ดํธ | |
setInterval(updateTopic, 20000); | |
</script> | |
</body> | |
</html> | |