# justjavac/weibo-trending-hot-search architecture

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

- Interactive diagram: https://gitdiagram.com/justjavac/weibo-trending-hot-search
- Repository: https://github.com/justjavac/weibo-trending-hot-search

## Overview

This repository is a scheduled Weibo hot-search scraper and public archive. The documented workflow runs hourly: fetch and parse Weibo’s trending page, merge and deduplicate results for the day, then update the raw JSON snapshot, the README’s current list, and a dated Markdown archive. The source excerpts show the scraper and formatting helpers; the hourly schedule is documented in the README. The exact scheduler implementation is not shown.

Main entry points: [`main.ts`](https://github.com/justjavac/weibo-trending-hot-search/blob/master/main.ts) (Scraper), [`utils.ts`](https://github.com/justjavac/weibo-trending-hot-search/blob/master/utils.ts) (Merge and render), [`raw`](https://github.com/justjavac/weibo-trending-hot-search/tree/master/raw) (Daily raw data), [`README.md`](https://github.com/justjavac/weibo-trending-hot-search/blob/master/README.md) (Current trends)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_hourly_trigger(("Hourly trigger"))
node_weibo["Weibo trends"]
node_scraper["Scraper<br/>[main.ts]"]
node_helpers["Merge and render<br/>[utils.ts]"]
node_raw_data[("Daily raw data")]
node_readme["Current trends<br/>[README.md]"]
node_archives["Daily archives"]

node_hourly_trigger -->|"starts hourly"| node_scraper
node_scraper -->|"fetches trends"| node_weibo
node_scraper -->|"merges and renders"| node_helpers
node_scraper -->|"reads prior snapshot"| node_raw_data
node_scraper -->|"writes snapshot"| node_raw_data
node_scraper -->|"updates list"| node_readme
node_scraper -->|"writes dated archive"| node_archives
node_helpers -->|"reads template"| node_readme

click node_scraper "https://github.com/justjavac/weibo-trending-hot-search/blob/master/main.ts"
click node_helpers "https://github.com/justjavac/weibo-trending-hot-search/blob/master/utils.ts"
click node_raw_data "https://github.com/justjavac/weibo-trending-hot-search/tree/master/raw"
click node_readme "https://github.com/justjavac/weibo-trending-hot-search/blob/master/README.md"
click node_archives "https://github.com/justjavac/weibo-trending-hot-search/tree/master/archives"

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_hourly_trigger,node_weibo toneIndigo
class node_scraper,node_helpers,node_readme,node_archives toneTeal
class node_raw_data toneAmber
```

## Components

### Other components

- **Hourly trigger**
- **Weibo trends**
- [Scraper](https://github.com/justjavac/weibo-trending-hot-search/blob/master/main.ts): `main.ts`
- [Merge and render](https://github.com/justjavac/weibo-trending-hot-search/blob/master/utils.ts): `utils.ts`
- [Daily raw data](https://github.com/justjavac/weibo-trending-hot-search/tree/master/raw): `raw`
- [Current trends](https://github.com/justjavac/weibo-trending-hot-search/blob/master/README.md): `README.md`
- [Daily archives](https://github.com/justjavac/weibo-trending-hot-search/tree/master/archives): `archives`

## Connections

- Hourly trigger → Scraper: starts hourly (evidence: `README.md`)
- Scraper → Weibo trends: fetches trends (evidence: `main.ts`)
- Scraper → Merge and render: merges and renders (evidence: `main.ts`)
- Scraper → Daily raw data: reads prior snapshot (evidence: `main.ts`)
- Scraper → Daily raw data: writes snapshot (evidence: `main.ts`)
- Scraper → Current trends: updates list (evidence: `main.ts`)
- Scraper → Daily archives: writes dated archive (evidence: `main.ts`)
- Merge and render → Current trends: reads template (evidence: `utils.ts`)
