openfree commited on
Commit
020670e
โ€ข
1 Parent(s): 9c9698b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +29 -14
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"