# Threads Explore

> Threads 內容抓取與瀏覽。觸發詞：搜索、查找、瀏覽首頁、刷一下、抓帖子、爬帖子、獲取帖子、看帖子詳情、查看用戶、用戶主頁、歷史回復、回復記錄、list-feeds、search、get-thread、user-profile、user-replies、抓取數據。

- **Type:** Skill
- **Install:** `agentstack add skill-gaojiongwenv587-beep-threads-skills-threads-explore`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [gaojiongwenv587-beep](https://agentstack.voostack.com/s/gaojiongwenv587-beep)
- **Installs:** 0
- **Category:** [Web & Browser](https://agentstack.voostack.com/c/web-and-browser)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [gaojiongwenv587-beep](https://github.com/gaojiongwenv587-beep)
- **Source:** https://github.com/gaojiongwenv587-beep/threads-skills/tree/main/threads-explore
- **Website:** https://openclaw.dev

## Install

```sh
agentstack add skill-gaojiongwenv587-beep-threads-skills-threads-explore
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

license: MIT-0
acceptLicenseTerms: true

# threads-explore — 内容发现

浏览首页 Feed、搜索内容、查看帖子详情和用户主页。

## 命令

### 首页 Feed

```bash
python scripts/cli.py list-feeds
python scripts/cli.py list-feeds --limit 30
```

实测返回示例：
```json
{
  "posts": [
    {
      "author": { "username": "user1", "displayName": "User One", "isVerified": false },
      "content": "帖子正文内容",
      "likeCount": "3,819",
      "replyCount": "42",
      "repostCount": "8",
      "quoteCount": "",
      "createdAt": "2025-03-10T12:34:56",
      "url": "https://www.threads.net/@user1/post/xxx"
    }
  ]
}
```

**说明**：
- `createdAt` 优先返回 ISO 时间戳，DOM 解析时可能返回相对时间（如 "3小时"）
- `likeCount` 为 Threads 显示格式（含逗号分隔）
- `postId` 在首页 Feed 中可能为空，使用 `url` 传给互动命令
- **批量抓取**：`--limit 50` 会自动滚动多次直到凑满，耗时约 1-3 分钟；连续 3 次无新帖自动停止
- **定时任务**：`list-feeds` 每次结果高度重叠（For You 算法池稳定）；若需增量抓新帖，改用 `search --query 关键词 --type recent`

### 搜索

```bash
# 默认搜索（热门内容）
python scripts/cli.py search --query "AI"

# 最近发布的帖子
python scripts/cli.py search --query "Python" --type recent

# 只搜用户
python scripts/cli.py search --query "tech" --type profiles

# 限制结果数
python scripts/cli.py search --query "設計" --limit 10
```

`--type` 可选值：`all`（默认热门）、`recent`（最新）、`profiles`（用户）

### 帖子详情

```bash
python scripts/cli.py get-thread --url "https://www.threads.net/@user/post/xxx"
```

返回帖子原文 + 回复列表。

### 用户主页

```bash
python scripts/cli.py user-profile --username "@someuser"
python scripts/cli.py user-profile --username "someuser"   # @ 可选
python scripts/cli.py user-profile --username "someuser" --limit 20
```

返回用户基本信息（粉丝数、简介）和最近帖子列表。

### 用户历史回复

```bash
python scripts/cli.py user-replies --username "@someuser"
python scripts/cli.py user-replies --username "someuser" --limit 30
```

抓取 `/@用户名/replies` Tab 的历史回复列表，字段与 `user-profile` 帖子相同。

## 决策逻辑

1. 用户说"首页" / "刷一下" / "看看推荐" → `list-feeds`
2. 用户提供关键词说"搜索" → `search --query 关键词`，热门用默认，最新加 `--type recent`，找人加 `--type profiles`
3. 用户提供 Thread URL → `get-thread --url URL`
4. 用户提供用户名 → `user-profile --username 用户名`
5. 用户说"历史回复" / "回复记录" / 用户名 + "回复" → `user-replies --username 用户名`

## 返回数据说明

- `url`：帖子完整 URL，可直接传给 `like-thread` / `reply-thread` / `repost-thread`
- `likeCount` / `replyCount` / `repostCount`：字符串，Threads 显示格式
- `createdAt`：ISO 时间戳（JSON 数据）或相对时间字符串（DOM 解析降级）

## 失败处理

| 错误 | 原因 | 处理 |
|------|------|------|
| 帖子内容为空 | 页面结构更新或加载失败 | 滚动后重试，或检查 `scripts/threads/selectors.py` |
| 用户不存在 | 用户名拼写错误或已注销 | 确认用户名 |
| 搜索结果为空 | 关键词无匹配或网络超时 | 换关键词或检查网络 |
| 连接 Chrome 失败 | Chrome 未启动 | 运行 `python scripts/chrome_launcher.py` |

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [gaojiongwenv587-beep](https://github.com/gaojiongwenv587-beep)
- **Source:** [gaojiongwenv587-beep/threads-skills](https://github.com/gaojiongwenv587-beep/threads-skills)
- **License:** MIT
- **Homepage:** https://openclaw.dev

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-gaojiongwenv587-beep-threads-skills-threads-explore
- Seller: https://agentstack.voostack.com/s/gaojiongwenv587-beep
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
