Enhance message parsing and HTML rendering for Telegram posts

This commit is contained in:
vvzvlad
2025-02-01 18:31:14 +03:00
parent 20221c78e1
commit bcac493e4b
2 changed files with 159 additions and 21 deletions
+30 -1
View File
@@ -29,7 +29,36 @@ async def get_post_html(channel: str, post_id: int):
)
return f"""
<html>
<body style="font-family: Arial; margin: 20px;">
<head>
<title>Post {post_id}</title>
<style>
body {{ font-family: Arial; margin: 20px; }}
.poll {{
border: 1px solid #ddd;
padding: 15px;
margin: 20px 0;
border-radius: 8px;
}}
.poll-option {{
margin: 10px 0;
}}
.progress-bar {{
height: 20px;
background: #4CAF50;
border-radius: 4px;
margin: 5px 0;
}}
.stats {{
color: #666;
font-size: 0.9em;
}}
.total {{
margin-top: 15px;
font-weight: bold;
}}
</style>
</head>
<body>
{post['text']}
</body>
</html>