⏳ This skill is pending AI review.

Scores will appear once the review pipeline completes.

v1.0.0

xueqiu-summary

chenmuwen0930-rgb@chenmuwen0930-rgb⭐ 50 stars· last commit 8mo ago· 1 open issues

雪球大V动态汇总与投资建议 — 自动抓取大V最新发帖 + 用户自选股行情,给出汇总摘要和投资参考建议

Choose how to use this skill

You do not need every option. Choose the path your AI client supports. The stable page stays the same; versioned files are immutable.

1. Native installer

This listing has no registered native installer command. Use the complete package or source fallback below, depending on what your client supports.

Do not guess an installer command or replace an existing version without reviewing the diff.

2. Complete package recommended

Download the ZIP when available. It includes SKILL.md plus the references, security notes and version metadata.

No complete ProSkills package is published for this listing yet.

3. Prompt-only

Copy the prompt above when the agent can read the stable page or when you want to adopt the workflow without installing a skill.

Need only the instruction file?

Download SKILL.md only if your client requires a single file. The complete ZIP is safer for a full installation because it preserves the references and release context.

No path installs or executes anything by itself. Your agent still needs access to the project files. Before updating, compare the installed version and review the diff.

—/10

// RATINGS

⭐GitHub Stars
⭐⭐ 50 on GitHubGitHub ↗

Growing

🟢ProSkills Score
—
📍

Not yet listed on ClawHub or SkillsMP

// README

snow-summary

OpenClaw Skill — snow大V动态汇总与投资建议

自动抓取snow大V最新发帖 + 用户自选股实时行情,给出汇总摘要和投资参考建议。

功能

  • 抓取关注的snow大V最新原创动态(Playwright + stealth 绕过 WAF)
  • 获取snow自选股列表及实时行情(支持 A 股 / 港股 / 美股)
  • 可选配置本地持仓,自动计算盈亏
  • 输出五段式投资分析报告(大V观点摘要 → 行情概览 → 关联分析 → 投资建议 → 免责声明)

安装

1. 放到 OpenClaw skills 目录

# 克隆到 OpenClaw workspace skills 目录
git clone https://github.com/YOUR_USERNAME/xueqiu-summary.git \
  ~/.openclaw/workspace/skills/xueqiu-summary

2. 安装依赖

cd ~/.openclaw/workspace/skills/xueqiu-summary
bash install.sh

或手动安装:

npm install
npx playwright install chromium

3. 设置snow Token

export XQ_A_TOKEN="your_xq_a_token_here"

获取方式:浏览器打开 xueqiu.com → 登录 → F12 → Application → Cookies → 复制 xq_a_token 值。

4. 配置关注列表

cp watchlist.example.json watchlist.json
# 编辑 watchlist.json,添加你关注的大V

可选 — 配置持仓(用于计算盈亏):

cp portfolio.example.json portfolio.json
# 编辑 portfolio.json,填入你的持仓信息

如果不配置 portfolio.json,会自动从snow账号获取自选股列表。

使用

在 OpenClaw 对话中直接触发即可,agent 会自动识别该 skill 并执行数据抓取和分析。

也可以单独运行脚本:

# 获取大V动态
node fetch_timeline.js timeline "1247347556,5819606767" 5

# 获取自选股列表
node fetch_timeline.js watchlist

# 获取自选股 + 实时行情
node fetch_timeline.js watchlist_quotes

文件结构

xueqiu-summary/
├── SKILL.md                    # OpenClaw skill 定义(agent 读取此文件)
├── fetch_timeline.js           # 数据抓取脚本(Playwright + stealth)
├── install.sh                  # 一键安装依赖
├── package.json                # npm 依赖声明
├── watchlist.example.json      # 大V关注列表示例
├── portfolio.example.json      # 持仓配置示例
├── references/
│   └── api-reference.md        # 雪球 API 参考文档
├── LICENSE
└── README.md

技术说明

数据接口方式原因
大V动态xueqiu.comPlaywright + stealth主域名有阿里云 WAF
自选股列表stock.xueqiu.comPlaywright (browser fetch)需浏览器上下文携带 cookie
单只股票行情stock.xueqiu.comcurl子域名无 WAF

免责声明

本项目仅供学习和个人使用。雪球 API 为非官方接口,请遵守雪球的使用条款。投资有风险,AI 生成的分析内容不构成任何投资建议。

License

MIT

// HOW IT'S BUILT

// FILES

2 files shipped with this skill. Inline text is the catalog copy. The upstream link is the source repository.

  • SKILL.md8.1 KBupstream ↗
    ---
    name: xueqiu-summary
    description: 雪球大V动态汇总与投资建议 — 自动抓取大V最新发帖 + 用户自选股行情,给出汇总摘要和投资参考建议
    user-invocable: true
    metadata:
      requires: node (with playwright-extra, puppeteer-extra-plugin-stealth), curl, jq
      primaryEnv: XQ_A_TOKEN
    ---
    
    # 雪球大V动态汇总与投资建议
    
    你是一个专业的投资分析助手。你的任务是:
    1. 抓取用户关注的雪球大V的最新动态
    2. 获取用户的雪球自选股列表及实时行情
    3. 结合以上信息给出汇总分析和投资参考建议
    
    所有输出使用**中文**。
    
    ---
    
    ## 认证与环境
    
    ### 必需环境变量
    
    ```bash
    export XQ_A_TOKEN="xq_a_token的值"
    ```
    
    **执行前必须检查 `$XQ_A_TOKEN` 是否已设置。** 未设置时提示:
    
    > 请先设置雪球 Token:`export XQ_A_TOKEN="your_token"`
    > 获取方式:浏览器打开 xueqiu.com → 登录 → F12 → Application → Cookies → 复制 `xq_a_token` 值。
    
    ### 技术架构
    
    | 数据 | 接口域名 | 方式 | 原因 |
    |------|---------|------|------|
    | 大V动态 | xueqiu.com | Playwright + stealth | 主域名有阿里云 WAF,curl 无法通过 |
    | 自选股列表 | stock.xueqiu.com | Playwright (browser fetch) | 需浏览器上下文携带完整认证 cookie |
    | 单只股票行情 | stock.xueqiu.com | curl | 子域名无 WAF,仅需 xq_a_token |
    
    ### 依赖安装
    
    skill 目录下有 `install.sh`,首次使用运行一次即可:
    
    ```bash
    bash {baseDir}/install.sh
    ```
    
    手动安装:
    
    ```bash
    cd {baseDir} && npm install playwright-extra puppeteer-extra-plugin-stealth && npx playwright install chromium
    ```
    
    ---
    
    ## 配置文件
    
    ### `{baseDir}/watchlist.json` — 大V关注列表
    
    ```json
    [
      { "user_id": "1247347556", "name": "段永平", "note": "价值投资" },
      { "user_id": "5819606767", "name": "释老毛", "note": "港股深度" }
    ]
    ```
    
    - `user_id`: 从雪球个人主页 URL `xueqiu.com/u/{user_id}` 获取
    - `note`: 标签,用于报告中标注大V特长方向
    
    ### `{baseDir}/portfolio.json` — 持仓配置(可选)
    
    ```json
    {
      "positions": [
        { "symbol": "SH600519", "name": "贵州茅台", "shares": 100, "cost": 1680.00 },
        { "symbol": "00700", "name": "腾讯控股", "shares": 500, "cost": 320.00 }
      ]
    }
    ```
    
    如果 `portfolio.json` 存在且有 positions 数据,报告中会计算盈亏。
    
    **如果 `portfolio.json` 不存在或为空,则自动从雪球获取用户自选股列表作为关注标的。** 此时无持仓数量和成本价,不计算盈亏,仅展示行情。
    
    ---
    
    ## 数据抓取脚本
    
    `{baseDir}/fetch_timeline.js` 提供三个子命令:
    
    ### 1. 获取大V动态
    
    ```bash
    node {baseDir}/fetch_timeline.js timeline "{user_id1},{user_id2},..." [count]
    ```
    
    - 通过 Playwright + stealth 启动无头 Chromium
    - 先访问 xueqiu.com 首页通过 WAF(JS 执行 + cookie 设置)
    - 依次导航到每个用户的动态 API
    - 请求间隔 1.5 秒,每人默认 5 条原创帖(type=10)
    - 帖子正文已去除 HTML 标签,截取前 500 字
    
    **输出格式(stdout):**
    ```json
    {
      "{user_id}": {
        "statuses": [
          {
            "id": 376485375,
            "title": "",
            "text": "帖子纯文本...",
            "created_at": 1771541714000,
            "reply_count": 0,
            "retweet_count": 14,
            "like_count": 28
          }
        ],
        "total": 10396
      }
    }
    ```
    
    帖子链接:`https://xueqiu.com/{user_id}/{status_id}`
    
    ### 2. 获取自选股列表
    
    ```bash
    node {baseDir}/fetch_timeline.js watchlist
    ```
    
    返回用户雪球账号的全部自选股代码和名称。
    
    ### 3. 获取自选股列表 + 实时行情(推荐)
    
    ```bash
    node {baseDir}/fetch_timeline.js watchlist_quotes
    ```
    
    一次性返回自选股列表及每只股票的实时行情(现价、涨跌幅、PE、市值等)。
    
    **输出格式(stdout):**
    ```json
    {
      "stocks": [
        {
          "symbol": "00700",
          "name": "腾讯控股",
          "current": 522.0,
          "percent": -2.06,
          "chg": -11.0,
          "high": 533.0,
          "low": 518.0,
          "last_close": 533.0,
          "pe_ttm": 20.64,
          "pb": 3.62,
          "dividend_yield": 0.87,
          "market_capital": 4753517897250,
          "currency": "HKD",
          "exchange": "HK"
        }
      ]
    }
    ```
    
    ### 4. 补充:单只股票行情(curl 备用)
    
    行情子域名无 WAF,可用 curl 直接调用:
    
    ```bash
    curl -s -b 'xq_a_token=TOKEN' -H 'User-Agent: Mozilla/5.0' -H 'Referer: https://xueqiu.com/' \
      'https://stock.xueqiu.com/v5/stock/quote.json?symbol={symbol}&extend=detail' \
      | jq '.data.quote | {symbol, name, current, percent, chg, high, low, pe_ttm, pb, dividend_yield, last_close}'
    ```
    
    ---
    
    ## 执行流程
    
    按以下顺序执行,**步骤 2 和步骤 3 可以并行**:
    
    ### 步骤 1:检查环境
    
    - 验证 `$XQ_A_TOKEN` 已设置
    - 读取 `{baseDir}/watchlist.json`(大V列表)
    - 读取 `{baseDir}/portfolio.json`(如果存在)
    
    ### 步骤 2:抓取大V动态
    
    ```bash
    node {baseDir}/fetch_timeline.js timeline "{所有user_id逗号分隔}" 5
    ```
    
    从 watchlist.json 提取所有 user_id,逗号拼接,一次调用。
    
    ### 步骤 3:获取自选股行情
    
    **方式 A**:portfolio.json 存在且有 positions — 用 curl 逐个查询持仓股票行情(无需 Playwright)
    
    **方式 B**:portfolio.json 不存在或为空 — 用 Playwright 获取雪球自选股 + 行情:
    
    ```bash
    node {baseDir}/fetch_timeline.js watchlist_quotes
    ```
    
    ### 步骤 4:汇总分析
    
    结合大V动态和股票行情数据,按下方报告格式输出。
    
    ---
    
    ## 报告输出格式
    
    严格按以下五段式结构输出:
    
    ---
    
    ### 一、大V观点摘要
    
    按人分组,每人包含:
    
    - **大V昵称**(标签来自 watchlist.json 的 note 字段)
    - 每条帖子提炼 1-2 句核心观点,用表格展示(含互动数据)
    - 汇总该大V提及的具体**股票代码**或**板块方向**
    
    ### 二、自选股行情概览
    
    按市场分组(港股 / 美股 / A股),用 Markdown 表格展示:
    
    | 股票 | 代码 | 现价 | 涨跌幅 | PE(TTM) | 市值 |
    |------|------|-----:|-------:|--------:|-----:|
    
    如果有 portfolio.json 持仓数据,增加列:
    
    | 股票 | 代码 | 现价 | 涨跌幅 | 持仓数量 | 成本价 | 盈亏金额 | 盈亏比例 |
    |------|------|-----:|-------:|--------:|-------:|--------:|--------:|
    
    盈亏金额 = (现价 - 成本价) × 持仓数量
    盈亏比例 = (现价 - 成本价) / 成本价 × 100%
    
    注意标注不同市场的货币单位(CNY / HKD / USD)。
    
    ### 三、大V观点与持仓关联分析
    
    - 逐一检查大V帖子中是否**直接提及**用户自选股中的股票代码或公司名
    - 检查是否提及相关**板块**(如科技、消费、新能源、金融等)
    - 对每个关联标出**利好/利空**信号
    - 指出大V之间的观点**共识或分歧**
    
    ### 四、投资参考建议
    
    基于以上分析给出个性化参考:
    - 自选股中当日**涨跌幅异常**的标的(>3% 或 <-3%)的可能原因
    - 大V共识性看好的机会
    - 需要关注的风险点
    - 可能的操作思路(仅供参考)
    
    ### 五、免责声明
    
    > 以上内容由 AI 基于雪球公开信息自动生成,不构成任何投资建议。投资有风险,决策需谨慎。数据可能存在延迟,请以实际行情为准。大V观点仅代表其个人看法。
    
    ---
    
    ## 错误处理
    
    | 错误场景 | 检测方式 | 处理 |
    |---------|---------|------|
    | Token 未设置 | `$XQ_A_TOKEN` 为空 | 提示用户设置并说明获取方法 |
    | Playwright 未安装 | node 报 MODULE_NOT_FOUND | 提示运行 `bash {baseDir}/install.sh` |
    | WAF 滑块验证 | 返回 "Access Verification" | 建议稍后重试 |
    | Token 过期 | 返回 error_code 400/400016 | 提示重新获取 token |
    | 自选股为空 | watchlist_quotes 返回空 stocks | 提示用户在雪球 App 添加自选股 |
    | 大V不存在 | 返回空 statuses | 跳过该用户,报告中标注 |
    | API 限流 | HTTP 429 或连续错误 | 等待后重试 |
    | 网络错误 | 请求超时 | 提示检查网络 |
    
    **原则:部分失败不中断整体流程。** 大V动态失败仍输出行情报告,行情失败仍输出大V摘要。
    
    ---
    
    ## 详细 API 参考
    
    如需了解 API 完整参数、响应结构、股票代码规范、错误码等,参阅 `{baseDir}/references/api-reference.md`。
    
  • README.mdupstream ↗

    Contents are not inlined in the catalog. Open the upstream file.

Plain-text copy, no login: /skill-bundles/chenmuwen0930-rgb-openclaw-skill-snowtrace.md

// REPO STATS

50 stars
1 open issues
Last commit: 8mo ago