Xpersona
X

X Profile Deep Dive

CLAWHUB · Unverified

深度分析 X/Twitter 用户画像——通过 tweety-ns 抓取推文、关注和粉丝, 生成中文深度档案(主题分类、内容风格、社交网络)。 Use when: (1) 用户说"深挖 @xxx"/"分析这个博主"/"analyze @xxx", (2) 用户说"看看他都发了什么"/"这个人什么水平"/"值不值得... Skill: X Profile Deep Dive Owner: lovensky1992-wk Summary: 深度分析 X/Twitter 用户画像——通过 tweety-ns 抓取推文、关注和粉丝, 生成中文深度档案(主题分类、内容风格、社交网络)。 Use when: (1) 用户说"深挖 @xxx"/"分析这个博主"/"analyze @xxx", (2) 用户说"看看他都发了什么"/"这个人什么水平"/"值不值得... Tags: latest:1.0.5 Version history: v1.0.5 | 2026-05-06T06:29:32.256Z | user Weekly sync v1.0.4 | 2026-04-26T12:35:05.575Z | user Weekly sync v1.0.3 | 2026-04-19T04:03:38.084Z | user Daily sync v1.0.2

62
Rank
84
Safety
1.3k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1.3K downloads reported by the source. Last updated 10/10/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 s17dsprt4znvnqphy9hhy68va983nsqs:x-profile-deep-dive
  1. Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.
  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-lovensky1992-wk-x-profile-deep-dive/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

74,825 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
name: x-profile-deep-dive
version: 1.0.0
description: >
  深度分析 X/Twitter 用户画像——通过 tweety-ns 抓取推文、关注和粉丝,
  生成中文深度档案(主题分类、内容风格、社交网络)。
  Use when: (1) 用户说"深挖 @xxx"/"分析这个博主"/"analyze @xxx",
  (2) 用户说"看看他都发了什么"/"这个人什么水平"/"值不值得关注",
  (3) 用户说"扒一扒 @xxx"/"做个 X 账号档案",
  (4) 用户要求了解某个 Twitter 博主的内容、风格、影响力。
  NOT for: 单条推文翻译/讨论(直接处理)、
  X 信息流日报/digest(用 x-digest cron 任务)、
  发推/点赞/互动操作(用浏览器手动)。
  Requires tweety-ns and Twitter cookies.
---

# X Profile Deep Dive

对 X/Twitter 博主进行深度画像分析:数据采集 → LLM 动态分类 → 摘要卡片 + 分类全集输出。

## 前置条件

```bash
# 一次性检查三个条件
pip3 show tweety-ns >/dev/null 2>&1 && echo "✅ tweety-ns" || echo "❌ pip3 install tweety-ns"
[ -f <WORKSPACE>/config/twitter_cookies.json ] && echo "✅ cookies" || echo "❌ cookies 缺失"
[ -d <WORKSPACE>/config/tw_session/ ] && echo "✅ session" || echo "❌ session 目录缺失"
```

Cookies 缺失 → 提示用户通过 CDP 从 openclaw browser 提取。

## 预计耗时

| 阶段 | 耗时 | 说明 |
|------|------|------|
| Phase 1 数据采集 | 1-2 分钟 | tweety-ns API 调用 |
| Phase 1.5 Articles | 2-5 分钟 | 浏览器滚动,视博主文章数量而定 |
| Phase 2-3 分析+分类 | 1-3 分钟 | 视推文数量而定 |
| Phase 4-5 输出 | 1 分钟 | 文件写入+汇报 |
| **总计** | **5-11 分钟** | |

**确认点**:开始前告知用户预计耗时,确认后再开始。

## 完整流程

### Phase 1: 数据采集

运行脚本采集原始数据:

```bash
python3 scripts/x_profile_analyzer.py \
  --handle {handle} \
  --tweet-pages 8 \
  --cookies <WORKSPACE>/config/twitter_cookies.json \
  --output /tmp/x-profile-raw-{handle}.json
```

参数说明:
- `--tweet-pages 8`:默认 8 页(约 160 条推文),可根据需要调整
- `--following-pages 1`:关注列表采样 70 人(通常够用)
- `--follower-pages 1`:粉丝采样 70 人(可能因 elevated auth 失败,非关键)

脚本退出码:1=cookies missing, 2=login failed, 3=user not found

### Phase 1.5: Articles 专项采集 + 外链探索

**tweety-ns 的 tweet pages 可能采不全 X Articles(长文),且博主可能在外部平台有独占内容。此步骤必须执行。**

#### 1.5.1 X Articles 完整采集

用浏览器打开 `x.com/{handle}/articles`,完整滚动收集所有 Article:

1. `browser navigate` → `x.com/{handle}/articles`
2. **逐段滚动**(每次 `scrollBy(0, 1500)`),每段做 snapshot 记录当前可见的 article 标题+日期+URL
3. **累计去重**:X 使用虚拟滚动(virtual scrolling),会回收不在视口的 DOM 节点。**绝不能用最后一次 snapshot 的 article 数量当总数**。必须在脑中/笔记中累计所有已看到的唯一 article
4. 持续滚动直到**不再出现新 article**(连续 2 次滚动无新增 = 到底)
5. 记录总数,与 Phase 1 采到的 Articles 数量对比,补全遗漏

⚠️ **虚拟滚动陷阱**(2026-03-16 教训):
- X 的 timeline 页面使用虚拟滚动,视口外的 article 元素会被回收
- `document.querySelectorAll('article').length` 只返回当前 DOM 中的数量,不是总数
- 必须逐段滚动 + 手动累计去重,这是唯一可靠的计数方式

#### 1.5.2 外链探索

检查博主 bio 中的外部链接(博客/Substack/Medium/Newsletter/GitHub):

1. 从 Phase 1 的 profile 数据或 README 中提取 bio 链接
2. 如果有博客/Newsletter → 用 browser 打开,找到长文列表页
3. 对比博客长文列表 vs X Articles 列表,识别**博客独占内容**(博客有但 X 没有的)
4. 对博客独占文章快速评估:深度原创 or 短新闻/聚合帖?主题相关度?
5. 在 README.md 中增加「📎 外部平台」章节,记录博客 URL + 独占内容数量 + 推荐收藏清单

### Phase 2: 数据分析

读取输出的 JSON,用 Python 提取关键统计信息(参考 [data-analysis.md](references/data-analysis.md)):
- 推文总数、时间跨度、发帖频率
- 互动中位数(likes/retweets/views)
- 语言分布、原创 vs 转推比例
- 高互动推文 Top 10

**确认点(大 V 场景)**:推文 >500 条时,告知用户分析范围(如"分析最近 160 条,覆盖约 X 天"),确认是否需要扩大采样。

### Phase 3: LLM 动态分类

**核心步骤**——不使用预设分类,而是根据推文内容动态生成分类。

1. 扫描所有推文全文,识别 3-6 个主题分类
2. 每个分类需要:名称(中文)、一句话描述、包含哪些推文
3. 分类原则:
   - 按内容主题而非形式分(不要"长文"/"短文"这种分

README.md

# X Profile Deep Dive

Deep profile analysis for X/Twitter accounts using OpenClaw.

## Features

- 📊 **Data Collection**: Fetch tweets, followings, and followers via tweety-ns
- 🏷️ **AI Classification**: LLM-powered thematic categorization of tweets
- 📝 **Comprehensive Dossier**: Generate detailed Chinese-language profile reports
- 🔍 **Network Analysis**: Map user's social connections and influence
- 💡 **Content Insights**: Identify key themes and posting patterns

## Prerequisites

- OpenClaw agent environment
- Python 3.8+
- tweety-ns library (`pip3 install tweety-ns`)
- Twitter/X cookies for authentication

## Installation

### Via ClawHub (Recommended)

```bash
clawhub install x-profile-deep-dive
```

### Manual Installation

1. Clone to `~/.openclaw/skills/x-profile-deep-dive`
2. Install dependencies:
   ```bash
   pip3 install tweety-ns
   ```
3. Set up Twitter cookies at `<WORKSPACE>/config/twitter_cookies.json`

## Usage

Talk to your OpenClaw agent:

```
深挖 @elonmusk
Analyze Twitter profile @paulg
生成 @sama 的画像报告
```

The skill will:
1. Collect recent tweets and network data
2. Classify content by themes
3. Generate a comprehensive Chinese report with relevance scoring

## Configuration

Set environment variables for custom paths:

- `TWITTER_COOKIES_PATH`: Path to Twitter cookies JSON file
- `TWITTER_SESSION_DIR`: Directory for tweety session data

## License

MIT License - see [LICENSE](LICENSE) file

_meta.json

{
  "ownerId": "kn7cy12yzara9p2s370vsanfe9824vnm",
  "slug": "x-profile-deep-dive",
  "version": "1.0.5",
  "publishedAt": 1778048972256
}

references/data-analysis.md

# Phase 2: 数据分析参考

从 x_profile_analyzer.py 输出的 JSON 中提取关键统计:

```python
import json

with open('/tmp/x-profile-raw-{handle}.json') as f:
    d = json.load(f)

p = d['profile']
ts = d['tweet_stats']
tweets = d['tweets']
followings = d['followings']

# 基本信息
print(f"{p['name']} (@{p['username']})")
print(f"Followers: {p['followers_count']} | Following: {p['following_count']}")
print(f"Tweets: {ts['total_fetched']} fetched | avg {ts['avg_likes']}❤️ | {ts['tweets_per_day']}/day")

# 按 likes 排序
tweets_sorted = sorted(tweets, key=lambda t: t['likes'], reverse=True)

# 推文长度分布
long = len([t for t in tweets if len(t['text']) > 2000])
mid = len([t for t in tweets if 500 < len(t['text']) <= 2000])
short = len([t for t in tweets if len(t['text']) <= 500])

# 类型分布
originals = len([t for t in tweets if not t['is_retweet'] and not t['is_reply']])
replies = len([t for t in tweets if t['is_reply']])
retweets = len([t for t in tweets if t['is_retweet']])
quotes = len([t for t in tweets if t['is_quote']])

# 含链接/媒体
with_links = len([t for t in tweets if t.get('urls')])
with_media = len([t for t in tweets if t.get('has_media')])
```

## 动态分类建议流程

1. 先打印所有推文的前 100 字 + likes 数,快速浏览主题
2. 根据关键词和内容相似性,提出 3-6 个分类
3. 每个分类起一个中文名 + 英文 slug(用作文件名)
4. 将推文 ID 分配到各分类
5. 一条推文只进一个分类(选最匹配的)

注意:分类要反映此博主的独特性,不要套用通用模板。例如:
- @karpathy → "nanochat 与模型训练" 是他独有的
- @Saboo_Shubham_ → "OpenClaw Agent 运营实战" 是他独有的
- 通用的"行业洞察"类别可以保留,但要有具体内容支撑

references/network-template.md

# network.md 模板

```markdown
# 社交网络分析

> {followers} 粉丝 / {following} 关注,采样 {N} 人

## 关注列表分类({N} 人采样)

### {分类名}({count} 人)

| Handle | 名称 | 粉丝 | 简介 |
|--------|------|------|------|
| @{username} | {name} | {followers_count} | {bio_snippet} |

{按粉丝数降序排列}

## 网络洞察

- **关注列表平均粉丝数**: {avg}
- **>100K 粉丝**: {count} 人 | **10K-100K**: {count} 人 | **<10K**: {count} 人
- **核心圈特征**:{1-2句总结}
- **推文互动模式**: {原创/回复/转发比例}
```

## 关注列表分类指导

根据 bio 和实际身份分类,常见类别:
- AI 研究者 & 科学家
- AI 工程 & 开源
- Agent/Claw 生态
- 创业 & 投资
- 媒体 & 内容创作
- 行业(电商/金融/教育等)

不必使用所有类别,按实际数据选择 3-6 个有意义的分类。每类至少 3 人。

Sponsored

Ads related to X Profile Deep Dive and adjacent AI workflows.