# user23333/kaka architecture

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

- Interactive diagram: https://gitdiagram.com/user23333/kaka
- Repository: https://github.com/user23333/kaka

## Overview

This repository is a scheduled forum-panel scraper and daily digest generator. Its workflow fetches three forum data blocks, parses hottest threads, downloadable files, and latest posts, merges new entries into a date-scoped cache, then writes a Markdown digest to both the dated history and README. The README documents those three output sections. Source excerpts show the fetch and persistence flow; the browser-backed scraper and cache are its key internal layers. The shown code does not establish how scheduling is triggered or how the forum provides its panel blocks.

Main entry points: [`panel.py`](https://github.com/user23333/kaka/blob/main/panel.py) (Panel scraper), [`main.py`](https://github.com/user23333/kaka/blob/main/main.py) (Daily runner), [`files/history`](https://github.com/user23333/kaka/tree/main/files/history) (Dated digest), [`README.md`](https://github.com/user23333/kaka/blob/main/README.md) (README digest)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_scrape["Forum scraping"]
  node_scraper["Panel scraper<br/>[panel.py]"]
  node_hot["Hottest threads<br/>[panel.py]"]
  node_downloads["Download listings<br/>[panel.py]"]
  node_latest["Latest threads<br/>[panel.py]"]
end

subgraph group_digest["Digest generation"]
  node_runner["Daily runner<br/>[main.py]"]
  node_markdown["Markdown renderer<br/>[main.py]"]
  node_history["Dated digest"]
  node_readme["README digest<br/>[README.md]"]
end

subgraph group_state["Local state"]
  node_cachelogic["Cache merge<br/>[main.py]"]
  node_cache[("Daily cache<br/>[cache.json]")]
end

node_operator(("Job trigger"))
node_forum["Forum panel"]
node_browser["Chromium"]

node_operator -.->|"runs"| node_runner
node_runner -->|"calls fetch"| node_scraper
node_scraper -->|"navigates"| node_browser
node_browser -->|"loads panel"| node_forum
node_scraper -->|"parses"| node_hot
node_scraper -->|"parses"| node_downloads
node_scraper -->|"parses"| node_latest
node_scraper -->|"returns blocks"| node_runner
node_runner -->|"merges entries"| node_cachelogic
node_cachelogic -->|"reads and writes"| node_cache
node_runner -->|"renders digest"| node_markdown
node_markdown -->|"writes"| node_history
node_markdown -->|"copies to"| node_readme

click node_runner "https://github.com/user23333/kaka/blob/main/main.py"
click node_scraper "https://github.com/user23333/kaka/blob/main/panel.py"
click node_hot "https://github.com/user23333/kaka/blob/main/panel.py"
click node_downloads "https://github.com/user23333/kaka/blob/main/panel.py"
click node_latest "https://github.com/user23333/kaka/blob/main/panel.py"
click node_cachelogic "https://github.com/user23333/kaka/blob/main/main.py"
click node_cache "https://github.com/user23333/kaka/blob/main/files/cache.json"
click node_markdown "https://github.com/user23333/kaka/blob/main/main.py"
click node_history "https://github.com/user23333/kaka/tree/main/files/history"
click node_readme "https://github.com/user23333/kaka/blob/main/README.md"

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_scraper,node_hot,node_downloads,node_latest toneBlue
class node_runner,node_markdown,node_history,node_readme toneAmber
class node_cachelogic,node_cache toneMint
class node_operator,node_forum,node_browser toneIndigo
```

## Components

### Forum scraping

- [Panel scraper](https://github.com/user23333/kaka/blob/main/panel.py): `panel.py`
- [Hottest threads](https://github.com/user23333/kaka/blob/main/panel.py): `panel.py`
- [Download listings](https://github.com/user23333/kaka/blob/main/panel.py): `panel.py`
- [Latest threads](https://github.com/user23333/kaka/blob/main/panel.py): `panel.py`

### Digest generation

- [Daily runner](https://github.com/user23333/kaka/blob/main/main.py): `main.py`
- [Markdown renderer](https://github.com/user23333/kaka/blob/main/main.py): `main.py`
- [Dated digest](https://github.com/user23333/kaka/tree/main/files/history): `files/history`
- [README digest](https://github.com/user23333/kaka/blob/main/README.md): `README.md`

### Local state

- [Cache merge](https://github.com/user23333/kaka/blob/main/main.py): `main.py`
- [Daily cache](https://github.com/user23333/kaka/blob/main/files/cache.json): `files/cache.json`

### Other components

- **Job trigger**
- **Forum panel**
- **Chromium**

## Connections

- Job trigger → Daily runner: runs
- Daily runner → Panel scraper: calls fetch (evidence: `main.py`)
- Panel scraper → Chromium: navigates (evidence: `panel.py`)
- Chromium → Forum panel: loads panel
- Panel scraper → Hottest threads: parses (evidence: `panel.py`)
- Panel scraper → Download listings: parses (evidence: `panel.py`)
- Panel scraper → Latest threads: parses (evidence: `panel.py`)
- Panel scraper → Daily runner: returns blocks (evidence: `main.py`)
- Daily runner → Cache merge: merges entries (evidence: `main.py`)
- Cache merge → Daily cache: reads and writes (evidence: `main.py`)
- Daily runner → Markdown renderer: renders digest (evidence: `main.py`)
- Markdown renderer → Dated digest: writes (evidence: `main.py`)
- Markdown renderer → README digest: copies to (evidence: `main.py`)
