From 691a3ccb22a270bd62d217fce5dc6af1e8feaeba Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 20 Oct 2026 21:43:25 +0200 Subject: [PATCH] =?UTF-8?q?Textos=20de=20=C3=81lex=20y=20Juan,=20men=C3=BA?= =?UTF-8?q?=20sin=20Shorts=20y=20contador=20de=20vistas=20en=20las=20minia?= =?UTF-8?q?turas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01TSyR5Zw5eGj6oPTRVjvP1b --- build.py | 27 +++++++---- public/index.html | 117 +++++++++++++++++++++++----------------------- public/styles.css | 13 ++++++ 3 files changed, 89 insertions(+), 68 deletions(-) diff --git a/build.py b/build.py index f2e9521..b3d38e7 100644 --- a/build.py +++ b/build.py @@ -175,6 +175,16 @@ def url(v): return f"https://www.youtube.com/watch?v={v['id']}" +EYE = ('') + + +def badge(v): + if not v['views']: + return '' + n = f"{v['views']:,}".replace(',', '.') + return f'{EYE}{n}' + + def vistas(v): return f"{v['views']:,}".replace(',', '.') + ' vistas' if v['views'] else '' @@ -182,16 +192,16 @@ def vistas(v): def card(v, n, show_views=False): return f''' - - {esc(v['title'])} + {badge(v)} + {esc(v['title'])} ''' def short_card(v, n, show_views=False): return f''' - - {esc(v['title'])}{'' if show_views and v['views'] else ''} + {badge(v)} + {esc(v['title'])} ''' @@ -222,7 +232,6 @@ page = f''' Anda que no sabes ná