Xpersona
B

Bilibili 热门趋势分析

CLAWHUB · Unverified

获取 Bilibili 全榜单热门数据并分析趋势。支持 21 个榜单,自动调用子 Agent 分析并生成 MD 报告持久化储存。安全无隐私风险,仅调用公开 API。 Skill: Bilibili 热门趋势分析 Owner: rookiecoder-jsjs Summary: 获取 Bilibili 全榜单热门数据并分析趋势。支持 21 个榜单,自动调用子 Agent 分析并生成 MD 报告持久化储存。安全无隐私风险,仅调用公开 API。 Tags: latest:1.0.3 Version history: v1.0.3 | 2026-06-03T03:32:16.996Z | user 新增功能 - 定时自动采集:python bili_trend.py daemon,按间隔自动循环采集全部或指定榜单,Ctrl+C 优雅退出。--interval 支持 2h/30m/90s 格式,--ranks 支持逗号分隔,--no-alert 关闭异常检测 - 异常检测与热点预警:alerts.py,4 类检测 —— 互动率飙升 [HOT]、分区热度突变 [WARN]、新 UP 主上榜 [INFO]

62
Rank
84
Safety
1.0k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1K downloads reported by the source. Last updated 10/11/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s177yz0szmgp3za3dkfyd2ddd9842jzt:bilibili-trending
  1. Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-rookiecoder-jsjs-bilibili-trending/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

26,127 characters of source documentation, loaded on request.

Extracted files

4 files captured from the source.

SKILL.md

---
name: Bilibili-trending
description: 获取 Bilibili 全榜单热门数据并分析趋势。支持 21 个榜单,自动调用子 Agent 分析并生成 MD 报告持久化储存。安全无隐私风险,仅调用公开 API。
---

# Bilibili Trending

获取 B 站热门数据 → 自动调用子 Agent 分析 → 持久化储存 → 趋势预测

## 安全说明

- **仅调用公开 API**:使用 B 站公开排行榜 API,不涉及登录、Cookie、用户信息
- **无个人信息**:只获取热门视频数据,不采集任何用户身份信息
- **本地存储**:数据保存在本地工作区,不上传到任何外部服务器
- **标准请求头**:仅使用标准 User-Agent,无特殊权限
- **自动重试**:API 限流(-352)时自动等待并重试(最多 3 次)

## 环境要求

- Python 3.x
- `requests` 库
- **OpenClaw 环境**(用于自动调用子 Agent)

## 支持 21 个榜单

| 类型 | 榜单 |
|------|------|
| **普通视频** | 全站、动画、游戏、音乐、舞蹈、鬼畜、影视、娱乐、知识、科技数码、美食、汽车、时尚美妆、体育运动、动物 |
| **PGC 内容** | 番剧、国创、纪录片、电影、电视剧 |

---

## 使用方式

> 以下命令在 skill 目录下执行(脚本会根据相对于工作区的位置自动创建所需目录)

### 抓取并分析单个榜单

```bash
cd skills/Bilibili-trending/scripts
python bilibili_all.py --rank <榜单>
```

示例:
```bash
python bilibili_all.py --rank game    # 游戏榜
python bilibili_all.py --rank tv      # 电视剧榜
python bilibili_all.py --rank anime   # 番剧榜
python bilibili_all.py --rank all     # 全站榜
```

### 列出所有榜单

```bash
python bilibili_all.py --list
```

### 手动模式(输出 prompt 不调用子 Agent)

```bash
python bilibili_all.py --rank game --manual
```

### 抓取并检测异常

```bash
python bilibili_all.py --rank game --alert    # 抓取后自动运行异常检测
python bilibili_all.py --rank game -a -m      # 手动模式 + 异常检测
```

---

## 完整流程

### Step 1: 抓取数据

脚本自动完成:
1. 调用 B 站 API 抓取数据
2. 处理数据(计算互动率、提取关键词)
3. 保存 JSON 到 `{工作区}/json/output_{rank_type}.json`
4. 更新趋势数据到 `trend.json`

### Step 2: 自动分析

脚本自动 spawn 子 Agent,发送分析 prompt

### Step 3: 保存报告

分析完成后,报告自动保存到:
```
{工作区}/memory/bilibili-analysis/{榜单名称}_{时间}.md
```
例如:`游戏_2026-04-02-15-30-45.md`

---

## 趋势分析命令

> 在 `skills/Bilibili-trending/scripts` 目录下执行

### 查看趋势

```bash
python bili_trend.py trend          # 全局趋势
python bili_trend.py trend game     # 单榜单趋势
```

### 生成周总结

```bash
python bili_trend.py weekly         # 全站周总结
python bili_trend.py weekly game    # 单榜单周总结
```

### 生成月总结

```bash
python bili_trend.py monthly        # 全站月总结
python bili_trend.py monthly game   # 单榜单月总结
```

### 对已有数据重新分析

```bash
python bili_trend.py workflow game           # 自动调用子 Agent
python bili_trend.py workflow game --manual  # 仅输出 prompt
```

### 定时自动采集

```bash
python bili_trend.py daemon                      # 默认 2h 间隔,采集全部 21 个榜单
python bili_trend.py daemon --interval 30m       # 每 30 分钟采集一次
python bili_trend.py daemon -i 4h -r game,anime  # 每 4 小时采集游戏+番剧榜
python bili_trend.py daemon --no-alert           # 关闭异常检测
```

按 `Ctrl+C` 优雅停止。

---

## 非 OpenClaw 环境

如果没有 OpenClaw 环境:
- 脚本检测到无法导入 `sessions_spawn`
- 自动输出 prompt 供手动使用
- 用户可将 prompt 发送给子 Agent 手动分析

---

## 关键词提取逻辑

```python
# 1. 正则提取 2-4 字中文
words = re.findall(r'[\u4e00-\u9fa5]{2,4}', title)

# 2. 统计词频
kw_counter = Counter(words)

# 3. 取 Top 10
top_keywords = [kw for kw, _ in kw_counter.most_common(10)]
```

---

## 环境变量

| 变量 | 说明 | 默认值 |
|------|------|--------|
| `BILIBILI_WORKSPACE` | 工作区路径(JSON 和报告的输出目录) | 自动检测(scripts/ 往上 3 级) |

---

## 异常检测

当使用 `--alert` 或 daemon 模式时,自动检测以下 4 类异常:

| 类型 | 级别 | 检测规则 |
|------|------|----------|
| **互动率飙升*

_meta.json

{
  "ownerId": "kn70ffyv4fahawdnwpdqh5pbs5842wpf",
  "slug": "bilibili-trending",
  "version": "1.0.3",
  "publishedAt": 1780457536996
}

references/workflow.md

# Bilibili 全榜单数据分析工作流

## 支持 21 个榜单

| 类型 | 榜单 |
|------|------|
| **普通视频** | 全站、动画、游戏、音乐、舞蹈、鬼畜、影视、娱乐、知识、科技数码、美食、汽车、时尚美妆、体育运动、动物 |
| **PGC 内容** | 番剧、国创、纪录片、电影、电视剧 |

## 完整自动化流程

### Step 1: 抓取数据

```bash
cd skills/Bilibili-trending/scripts
python bilibili_all.py --rank game
```

脚本自动完成:
1. 调用 B 站 API 抓取数据(自动重试 + 限流处理)
2. 提取关键词(正则 2-4 字中文,统计词频)
3. 计算统计数据(播放、互动率、UP 主、分区分布)
4. 保存 JSON 到 `{工作区}/json/output_{rank_type}.json`(含 owner 字段)
5. 更新趋势数据到 `trend.json`
6. 自动 spawn 子 Agent 分析

### Step 2: 子 Agent 分析(自动)

脚本自动调用 `sessions_spawn` 发送分析 prompt

### Step 3: 保存报告(自动)

分析完成后,报告自动保存为:
```
{工作区}/memory/bilibili-analysis/{榜单名称}_{时间}.md
```
例如:`游戏_2026-04-02-15-30-45.md`

### Step 4: 查看趋势

```bash
python bili_trend.py trend          # 全局
python bili_trend.py trend game    # 单榜单
```

### Step 5: 周/月总结

```bash
python bili_trend.py weekly         # 周总结
python bili_trend.py weekly game   # 单榜单周总结
python bili_trend.py monthly       # 月总结
python bili_trend.py monthly game  # 单榜单月总结
```

## 关键词提取逻辑

```python
# 1. 正则提取 2-4 字中文
words = re.findall(r'[\u4e00-\u9fa5]{2,4}', title)

# 2. 统计词频
kw_counter = Counter(words)

# 3. 取 Top 5
top_keywords = [kw for kw, _ in kw_counter.most_common(10)]
```

## 数据存储

脚本会在工作区自动创建目录结构:

```
{工作区}/
├── json/                           # JSON 数据目录
│   └── output_{rank_type}.json      # 原始数据
└── memory/bilibili-analysis/        # 分析结果目录
    ├── trend.json                    # 趋势累计数据
    ├── 游戏_2026-04-02-15-30-45.md  # 分析报告
    ├── 动画_2026-04-02-14-20-30.md
    ├── weekly-2026-W14.md           # 周总结
    └── monthly-2026-04.md          # 月总结
```

## 预测目标

通过长期积累(30+ 次),分析:
- 各榜单热门分区变化
- 关键词频次趋势
- 新兴关键词信号
- 下期热门题材预测

skill-card.md

## Description:

Collects public Bilibili ranking data across 21 charts, analyzes trends, detects anomalies, and stores JSON data and Markdown reports locally.

This skill is ready for commercial/non-commercial use.

## Publisher:

[rookiecoder-jsjs](https://clawhub.ai/user/rookiecoder-jsjs)

### License/Terms of Use:

MIT-0

## Use Case:

Developers and analysts use this skill to collect public Bilibili ranking data, track creator and topic trends, detect anomalies, and generate Chinese Markdown analysis reports for selected rankings.

### Deployment Geography for Use:

Global

## Known Risks and Mitigations:

Risk: Automatic analysis can pass public ranking content and creator fields to a spawned sub-agent.

Mitigation: Use manual mode or a tool-restricted analysis agent when sub-agent file, tool, or credential access should be constrained.

Risk: The skill persists ranking data, trend history, alert records, reports, and creator fields locally.

Mitigation: Set BILIBILI_WORKSPACE to a contained directory and review retained files before sharing or deploying the workspace.

Risk: Daemon or frequent collection can create repeated outbound requests and grow local history over time.

Mitigation: Use rank filters and reasonable collection intervals, and stop daemon mode when continuous monitoring is not needed.

## Reference(s):

- [ClawHub skill page](https://clawhub.ai/rookiecoder-jsjs/skills/bilibili-trending)
- [Bilibili all-rank workflow](references/workflow.md)

## Skill Output:

**Output Type(s):** [text, markdown, json, shell commands, configuration, guidance]

**Output Format:** [Markdown reports, JSON data files, command-line text, and reusable analysis prompts.]

**Output Parameters:** [1D]

**Other Properties Related to Output:** [Outputs may include local ranking data, trend history, alert records, creator fields, and reports under the configured BILIBILI_WORKSPACE.]

## Skill Version(s):

1.0.3 (source: server release evidence)

## Ethical Considerations:

Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.

Sponsored

Ads related to Bilibili 热门趋势分析 and adjacent AI workflows.