# alimbrrrr/krsu_news_bot architecture

> Architecture diagram of the GitHub repository alimbrrrr/krsu_news_bot, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/alimbrrrr/krsu_news_bot
- Repository: https://github.com/alimbrrrr/krsu_news_bot

## Overview

KRSU News Bot is a small scraper that fetches the university homepage, parses news cards, compares their links with saved entries, and persists only new items to JSON. The documented Telegram delivery and keyword subscriptions are plans, not implemented capabilities. Components share main.py because the runtime is a single-file script; news.json is a runtime data file not present in the repository tree.

Main entry points: [`main.py`](https://github.com/alimbrrrr/krsu_news_bot/blob/main/main.py) (Run workflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_user(("Operator"))
node_main["Run workflow<br/>[main.py]"]
node_fetch["Fetch news<br/>[main.py]"]
node_parse["Parse cards<br/>[main.py]"]
node_date["Normalize dates<br/>[main.py]"]
node_compare["Find new items<br/>[main.py]"]
node_load["Load saved news<br/>[main.py]"]
node_save["Save new news<br/>[main.py]"]
node_site["KRSU website"]
node_store["News JSON"]
node_console["Console"]

node_user -->|"runs"| node_main
node_main -->|"fetches"| node_fetch
node_main -->|"loads"| node_load
node_main -->|"compares"| node_compare
node_main -->|"saves"| node_save
node_main -->|"prints count"| node_console
node_fetch -->|"requests page"| node_site
node_fetch -->|"parses cards"| node_parse
node_parse -->|"normalizes date"| node_date
node_load -->|"reads"| node_store
node_save -->|"writes"| node_store

click node_main "https://github.com/alimbrrrr/krsu_news_bot/blob/main/main.py"
click node_fetch "https://github.com/alimbrrrr/krsu_news_bot/blob/main/main.py"
click node_parse "https://github.com/alimbrrrr/krsu_news_bot/blob/main/main.py"
click node_date "https://github.com/alimbrrrr/krsu_news_bot/blob/main/main.py"
click node_compare "https://github.com/alimbrrrr/krsu_news_bot/blob/main/main.py"
click node_load "https://github.com/alimbrrrr/krsu_news_bot/blob/main/main.py"
click node_save "https://github.com/alimbrrrr/krsu_news_bot/blob/main/main.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_user,node_site,node_store,node_console toneIndigo
class node_main,node_fetch,node_parse,node_date,node_compare,node_load,node_save toneTeal
```

## Components

### Other components

- **Operator**
- [Run workflow](https://github.com/alimbrrrr/krsu_news_bot/blob/main/main.py): `main.py`
- [Fetch news](https://github.com/alimbrrrr/krsu_news_bot/blob/main/main.py): `main.py`
- [Parse cards](https://github.com/alimbrrrr/krsu_news_bot/blob/main/main.py): `main.py`
- [Normalize dates](https://github.com/alimbrrrr/krsu_news_bot/blob/main/main.py): `main.py`
- [Find new items](https://github.com/alimbrrrr/krsu_news_bot/blob/main/main.py): `main.py`
- [Load saved news](https://github.com/alimbrrrr/krsu_news_bot/blob/main/main.py): `main.py`
- [Save new news](https://github.com/alimbrrrr/krsu_news_bot/blob/main/main.py): `main.py`
- **KRSU website**
- **News JSON**
- **Console**

## Connections

- Operator → Run workflow: runs (evidence: `README.md`)
- Run workflow → Fetch news: fetches (evidence: `main.py`)
- Run workflow → Load saved news: loads (evidence: `main.py`)
- Run workflow → Find new items: compares (evidence: `main.py`)
- Run workflow → Save new news: saves (evidence: `main.py`)
- Run workflow → Console: prints count (evidence: `main.py`)
- Fetch news → KRSU website: requests page (evidence: `main.py`)
- Fetch news → Parse cards: parses cards (evidence: `main.py`)
- Parse cards → Normalize dates: normalizes date (evidence: `main.py`)
- Load saved news → News JSON: reads (evidence: `main.py`)
- Save new news → News JSON: writes (evidence: `main.py`)
