Skip to content

Commit a99e099

Browse files
authored
Refactor README to remove legacy content
Remove legacy architecture details and update project structure.
1 parent d210d93 commit a99e099

1 file changed

Lines changed: 34 additions & 76 deletions

File tree

README.md

Lines changed: 34 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -20,105 +20,63 @@
2020
┌─────────────────────┐ guarda datos ┌──────▼──────────┐
2121
│ Repo: cYHBernews │ ◄──────────────── │ noticias.json │
2222
└─────────────────────┘ └─────────────────┘
23-
24-
---
25-
26-
## 🧩 Arquitectura Original (Legacy - Render)
27-
28-
29-
```
30-
┌─────────────┐ Telegram ┌──────────────────┐ scraping ┌──────────────────┐
31-
│ Usuario │ ◄───────────────► │ dev101_bot │ ◄─────────────► │ Fuentes news │
32-
└─────────────┘ │(Flask + Gunicorn)│ │ (4 websites) │
33-
└────────┬─────────┘ └──────────────────┘
34-
35-
│ AI summarize
36-
37-
┌─────────────────┐
38-
│ Groq │
39-
│ LLaMA 3.3 70B │
40-
└────────┬─────────┘
41-
42-
│ sendMessage
43-
44-
┌─────────────────┐
45-
│ Telegram │
46-
│ Bot API │
47-
└─────────────────┘
4823
```
4924

50-
```
51-
┌──────────────┐ 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-
***
7525
### Componentes
76-
26+
7727
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.
7828
2. **Cloudflare Workers** (`api/webhook.js`): El receptor. Recibe mensajes de Telegram y dispara el Action de GitHub cuando se usa `/noticias`.
7929
3. **Repositorio externo** (`DevCop95/cYHBernews`): El historial. Las noticias se guardan en `noticias.json` para deduplicación y persistencia.
30+
8031
---
81-
32+
8233
## 🚀 Setup
83-
34+
8435
### 1. GitHub Secrets
85-
36+
8637
Ve a **Settings > Secrets and variables > Actions** en este repositorio y configura:
87-
38+
8839
| Secreto | Descripción |
8940
|---------|-------------|
9041
| `GIT_TOKEN` | Personal Access Token (Classic) con scopes `repo` y `workflow` |
9142
| `TELEGRAM_TOKEN` | Token del bot obtenido con @BotFather |
9243
| `TELEGRAM_CHAT_ID` | Tu ID de Telegram (obtenido con @userinfobot) |
9344
| `GROQ_API_KEY` | API Key de [console.groq.com](https://console.groq.com/) |
9445
| `UNSPLASH_ACCESS_KEY` | (Opcional) Para imágenes aleatorias en las noticias |
95-
46+
9647
### 2. Cloudflare Workers — Variables de entorno
97-
48+
9849
En tu dashboard de Cloudflare Workers > tu worker > **Settings > Variables and Secrets**:
99-
50+
10051
| Variable | Valor |
10152
|----------|-------|
10253
| `TELEGRAM_TOKEN_ENV` | El mismo token de Telegram |
10354
| `TELEGRAM_CHAT_ID_ENV` | Tu ID de Telegram |
10455
| `GH_PAT_ENV` | El mismo `GIT_TOKEN` de GitHub |
105-
56+
10657
### 3. Registrar el Webhook en Telegram
107-
58+
10859
Ejecuta una sola vez en el navegador o con curl:
109-
60+
11061
```
11162
https://api.telegram.org/bot<TU_TOKEN>/setWebhook?url=https://dev101_bot.dev101-bot.workers.dev
11263
```
113-
64+
11465
---
115-
66+
67+
## 🤖 Comandos disponibles
68+
69+
| Comando | Descripción |
70+
|---------|-------------|
71+
| `/noticias` | Fuerza la búsqueda y envío de noticias al instante |
72+
| `/help` | Muestra los comandos disponibles |
73+
11674
El bot también envía noticias automáticamente **cada 3 horas** vía cron en GitHub Actions.
117-
75+
11876
---
119-
77+
12078
## 📁 Estructura del proyecto
121-
79+
12280
```
12381
dev101_bot/
12482
├── .github/
@@ -132,31 +90,31 @@ dev101_bot/
13290
├── .env.example # Plantilla de variables de entorno
13391
└── .gitignore
13492
```
135-
93+
13694
---
137-
95+
13896
## 📰 Fuentes de noticias
139-
97+
14098
| Fuente | Categoría |
14199
|--------|-----------|
142100
| CyberSecurity News | Ciberseguridad / IA |
143101
| WeLiveSecurity (ESET) | Ciberseguridad |
144102
| Xataka | IA |
145103
| WIRED en Español | IA |
146-
104+
147105
---
148-
106+
149107
## 📦 Dependencias
150-
108+
151109
```
152110
requests
153111
beautifulsoup4
154112
groq
155113
python-dotenv
156114
```
157-
115+
158116
---
159-
117+
160118
## 📝 Licencia
161-
162-
MIT © 2026 DevYHBMIT © 2026 DevYHB
119+
120+
MIT © 2026 DevYHB

0 commit comments

Comments
 (0)