Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -285,6 +285,7 @@ def get_vercel_deployments():
|
|
| 285 |
print(f"Error fetching Vercel deployments: {str(e)}")
|
| 286 |
return []
|
| 287 |
|
|
|
|
| 288 |
def get_vercel_card(deployment, index, is_top_best=False):
|
| 289 |
"""Vercel ๋ฐฐํฌ ์นด๋ HTML ์์ฑ ํจ์"""
|
| 290 |
raw_url = deployment.get('url', '')
|
|
@@ -302,7 +303,7 @@ def get_vercel_card(deployment, index, is_top_best=False):
|
|
| 302 |
# ์นด๋ ID ์์ฑ
|
| 303 |
card_id = f"vercel-card-{url.replace('.', '-').replace('/', '-')}"
|
| 304 |
|
| 305 |
-
# Top Best ํญ๋ชฉ์ผ
|
| 306 |
screenshot_html = ""
|
| 307 |
if is_top_best:
|
| 308 |
try:
|
|
@@ -322,6 +323,32 @@ def get_vercel_card(deployment, index, is_top_best=False):
|
|
| 322 |
tech_emojis = ['โก', '๐', '๐', 'โจ', '๐ซ', '๐ฅ', '๐', '๐ฏ', '๐จ', '๐ฎ']
|
| 323 |
random_emojis = random.sample(tech_emojis, 3)
|
| 324 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 325 |
return f"""
|
| 326 |
<div id="{card_id}" class="vercel-card"
|
| 327 |
data-likes="0"
|
|
@@ -350,19 +377,7 @@ def get_vercel_card(deployment, index, is_top_best=False):
|
|
| 350 |
</a>
|
| 351 |
<span style='font-size: 1.3em'>{random_emojis[1]}</span>
|
| 352 |
</h3>
|
| 353 |
-
|
| 354 |
-
<div style='margin: 15px 0; color: #444; background: rgba(255,255,255,0.5);
|
| 355 |
-
padding: 15px; border-radius: 12px;'>
|
| 356 |
-
<p style='margin: 8px 0;'>
|
| 357 |
-
<strong>Status:</strong> โ
{state}
|
| 358 |
-
</p>
|
| 359 |
-
<p style='margin: 8px 0;'>
|
| 360 |
-
<strong>Created:</strong> ๐
{created}
|
| 361 |
-
</p>
|
| 362 |
-
<p style='margin: 8px 0;'>
|
| 363 |
-
<strong>URL:</strong> ๐ {url}
|
| 364 |
-
</p>
|
| 365 |
-
</div>
|
| 366 |
<div style='margin-top: 20px; display: flex; justify-content: space-between; align-items: center;'>
|
| 367 |
<div class="like-section" style="display: flex; align-items: center; gap: 10px;">
|
| 368 |
<button onclick="toggleLike('{card_id}')" class="like-button"
|
|
|
|
| 285 |
print(f"Error fetching Vercel deployments: {str(e)}")
|
| 286 |
return []
|
| 287 |
|
| 288 |
+
|
| 289 |
def get_vercel_card(deployment, index, is_top_best=False):
|
| 290 |
"""Vercel ๋ฐฐํฌ ์นด๋ HTML ์์ฑ ํจ์"""
|
| 291 |
raw_url = deployment.get('url', '')
|
|
|
|
| 303 |
# ์นด๋ ID ์์ฑ
|
| 304 |
card_id = f"vercel-card-{url.replace('.', '-').replace('/', '-')}"
|
| 305 |
|
| 306 |
+
# Top Best ํญ๋ชฉ์ผ ๊ฒฝ์ฐ์ ์คํฌ๋ฆฐ์ท ์ฒ๋ฆฌ
|
| 307 |
screenshot_html = ""
|
| 308 |
if is_top_best:
|
| 309 |
try:
|
|
|
|
| 323 |
tech_emojis = ['โก', '๐', '๐', 'โจ', '๐ซ', '๐ฅ', '๐', '๐ฏ', '๐จ', '๐ฎ']
|
| 324 |
random_emojis = random.sample(tech_emojis, 3)
|
| 325 |
|
| 326 |
+
# Top Best์ ์ผ๋ฐ ์นด๋์ ๋ด์ฉ์ ๋ค๋ฅด๊ฒ ๊ตฌ์ฑ
|
| 327 |
+
if is_top_best:
|
| 328 |
+
info_section = f"""
|
| 329 |
+
<div style='margin: 15px 0; color: #444; background: rgba(255,255,255,0.5);
|
| 330 |
+
padding: 15px; border-radius: 12px;'>
|
| 331 |
+
<p style='margin: 8px 0;'>
|
| 332 |
+
<strong>URL:</strong> ๐ {url}
|
| 333 |
+
</p>
|
| 334 |
+
</div>
|
| 335 |
+
"""
|
| 336 |
+
else:
|
| 337 |
+
info_section = f"""
|
| 338 |
+
<div style='margin: 15px 0; color: #444; background: rgba(255,255,255,0.5);
|
| 339 |
+
padding: 15px; border-radius: 12px;'>
|
| 340 |
+
<p style='margin: 8px 0;'>
|
| 341 |
+
<strong>Status:</strong> โ
{state}
|
| 342 |
+
</p>
|
| 343 |
+
<p style='margin: 8px 0;'>
|
| 344 |
+
<strong>Created:</strong> ๐
{created}
|
| 345 |
+
</p>
|
| 346 |
+
<p style='margin: 8px 0;'>
|
| 347 |
+
<strong>URL:</strong> ๐ {url}
|
| 348 |
+
</p>
|
| 349 |
+
</div>
|
| 350 |
+
"""
|
| 351 |
+
|
| 352 |
return f"""
|
| 353 |
<div id="{card_id}" class="vercel-card"
|
| 354 |
data-likes="0"
|
|
|
|
| 377 |
</a>
|
| 378 |
<span style='font-size: 1.3em'>{random_emojis[1]}</span>
|
| 379 |
</h3>
|
| 380 |
+
{info_section}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 381 |
<div style='margin-top: 20px; display: flex; justify-content: space-between; align-items: center;'>
|
| 382 |
<div class="like-section" style="display: flex; align-items: center; gap: 10px;">
|
| 383 |
<button onclick="toggleLike('{card_id}')" class="like-button"
|