You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
┌──────────────┐ ping cada 5min ┌──────────────────────┐
52
-
│ UptimeRobot │ ─────────────────► │ Render │
53
-
└──────────────┘ │ (Docker Web Service)│
54
-
└──────────┬───────────┘
55
-
│
56
-
┌──────────▼───────────┐
57
-
│ Flask + Gunicorn │
58
-
│ /health │
59
-
└──────────────────────┘
60
-
```
61
-
62
-
**Render** aloja el bot 24/7 en Docker. **UptimeRobot** lo mantiene despierto con pings cada 5 minutos. El scheduler interno ejecuta el job de noticias cada 3 horas en un hilo separado.
63
-
64
-
***
65
-
66
-
## 📋 Requisitos Previos
67
-
68
-
- Python 3.11+
69
-
- Docker (opcional, para pruebas locales)
70
-
- Cuenta en [Render](https://render.com/) (gratis)
71
-
- Cuenta en [Groq](https://console.groq.com/) (gratis)
72
-
- Bot de Telegram (creado vía @BotFather)
73
-
74
-
***
75
25
### Componentes
76
-
26
+
77
27
1.**GitHub Actions** (`.github/workflows/bot.yml`): El motor del bot. Se ejecuta automáticamente cada 3 horas o manualmente vía webhook. Realiza el scraping, resume con IA y envía a Telegram.
78
28
2.**Cloudflare Workers** (`api/webhook.js`): El receptor. Recibe mensajes de Telegram y dispara el Action de GitHub cuando se usa `/noticias`.
79
29
3.**Repositorio externo** (`DevCop95/cYHBernews`): El historial. Las noticias se guardan en `noticias.json` para deduplicación y persistencia.
30
+
80
31
---
81
-
32
+
82
33
## 🚀 Setup
83
-
34
+
84
35
### 1. GitHub Secrets
85
-
36
+
86
37
Ve a **Settings > Secrets and variables > Actions** en este repositorio y configura:
87
-
38
+
88
39
| Secreto | Descripción |
89
40
|---------|-------------|
90
41
|`GIT_TOKEN`| Personal Access Token (Classic) con scopes `repo` y `workflow`|
91
42
|`TELEGRAM_TOKEN`| Token del bot obtenido con @BotFather|
92
43
|`TELEGRAM_CHAT_ID`| Tu ID de Telegram (obtenido con @userinfobot) |
93
44
|`GROQ_API_KEY`| API Key de [console.groq.com](https://console.groq.com/)|
94
45
|`UNSPLASH_ACCESS_KEY`| (Opcional) Para imágenes aleatorias en las noticias |
95
-
46
+
96
47
### 2. Cloudflare Workers — Variables de entorno
97
-
48
+
98
49
En tu dashboard de Cloudflare Workers > tu worker > **Settings > Variables and Secrets**:
99
-
50
+
100
51
| Variable | Valor |
101
52
|----------|-------|
102
53
|`TELEGRAM_TOKEN_ENV`| El mismo token de Telegram |
0 commit comments