Skip to content

Commit b3c6959

Browse files
committed
mouredev#40 - python
1 parent 2654844 commit b3c6959

File tree

1 file changed

+10
-7
lines changed
  • Roadmap/40 - FORTNITE RUBIUS CUP/python

1 file changed

+10
-7
lines changed

Roadmap/40 - FORTNITE RUBIUS CUP/python/SooHav.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@
66
import os
77
from dotenv import load_dotenv
88

9-
# Cargar las variables de entorno desde .env
9+
# Cargar las variables de entorno desde .env para obtener CLIENT_ID y CLIENT_SECRET
1010
load_dotenv()
1111

12-
# Obtener CLIENT_ID y CLIENT_SECRET desde las variables de entorno
1312
CLIENT_ID = os.getenv("CLIENT_ID")
1413
CLIENT_SECRET = os.getenv("CLIENT_SECRET")
1514

15+
# Funciones
16+
1617

1718
def obtener_token() -> str:
1819
url = "https://id.twitch.tv/oauth2/token"
@@ -116,6 +117,8 @@ def buscar_info_canal(token: str, broadcaster_id: str):
116117
"tópicos del canal": "sin información",
117118
}
118119

120+
# Uso de codigo
121+
119122

120123
token = obtener_token()
121124

@@ -221,18 +224,18 @@ def buscar_info_canal(token: str, broadcaster_id: str):
221224
print(f"Participante: {participante_evento_fortnite['usuario twitch']}, Estado: {
222225
participante_evento_fortnite['estado del usuario de twitch']}, Seguidores: {participante_evento_fortnite['total seguidores']}")
223226

224-
print("\nLista de antigueddad de las cuentas de los participantes del evento Rubius Cup en Twitch\n")
227+
print("\nLista de antiguedad de las cuentas de los participantes del evento Rubius Cup en Twitch\n")
225228

226229
# Participantes del evento Rubius Cup
227230
for participante_evento_fortnite in informacion_participantes_antiguedad:
228231
fecha_creacion = participante_evento_fortnite.get("creación de cuenta")
229232

230233
if isinstance(fecha_creacion, datetime):
231-
fecha_visual = fecha_creacion.strftime("%d-%m-%Y %H:%M:%S")
234+
fecha = fecha_creacion.strftime("%d-%m-%Y %H:%M:%S")
232235
elif isinstance(fecha_creacion, str):
233-
fecha_visual = fecha_creacion
236+
fecha = fecha_creacion
234237
else:
235-
fecha_visual = "Información no disponible"
238+
fecha = "Información no disponible"
236239

237240
print(f"Participante: {participante_evento_fortnite['usuario twitch']}, Estado: {
238-
participante_evento_fortnite['estado del usuario de twitch']}, Creación de cuenta: {fecha_visual}")
241+
participante_evento_fortnite['estado del usuario de twitch']}, Creación de cuenta: {fecha}")

0 commit comments

Comments
 (0)