← Back to Skills Marketplace
hwl1413520

竞品数据定时监控

by rumu14 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
101
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install competitor-monitor-ai
Description
竞品数据定时监控Skill,定时访问指定电商或社交平台页面,抓取点赞、评论、销量等数据,检测数据异常波动(如出现爆款),自动截图并发送提醒通知。适用于竞品分析、市场监控、爆款发现等场景。
README (SKILL.md)

竞品数据定时监控 Skill

用途

本 Skill 用于定时监控竞品在电商平台或社交平台的数据表现,帮助用户:

  • 自动抓取竞品的点赞、评论、销量等关键数据
  • 追踪数据变化趋势,生成可视化报表
  • 检测数据异常波动(如出现爆款、数据暴增)
  • 自动截图保存关键页面
  • 及时发送提醒通知

适用平台

电商平台

  • 淘宝/天猫:商品销量、评价数、价格
  • 京东:商品销量、评价数、价格
  • 拼多多:销量、评价、价格
  • 抖音电商:销量、点赞、评论
  • 小红书电商:销量、点赞、收藏

社交平台

  • 抖音:视频点赞、评论、转发、播放量
  • 小红书:笔记点赞、收藏、评论
  • 微博:转发、评论、点赞
  • B站:播放量、点赞、投币、收藏
  • 快手:点赞、评论、播放量

核心功能

1. 定时数据采集

  • 支持自定义监控频率(每小时/每天/每周)
  • 支持多平台同时监控
  • 支持批量监控多个竞品链接

2. 数据抓取

  • 自动抓取点赞数、评论数、销量等关键指标
  • 支持JavaScript渲染页面
  • 自动处理反爬机制

3. 异常检测

  • 检测数据异常波动(如点赞数暴增)
  • 识别潜在爆款
  • 支持自定义异常阈值

4. 自动截图

  • 异常时自动截图保存
  • 支持全页面截图
  • 截图带时间戳存档

5. 提醒通知

  • 支持多种通知方式(邮件、微信、钉钉、飞书)
  • 支持自定义提醒内容
  • 支持异常摘要报告

工作流程

第一步:配置监控任务

创建监控配置文件 config/monitor_tasks.json

{
  "tasks": [
    {
      "id": "task_001",
      "name": "竞品A-抖音监控",
      "platform": "douyin",
      "url": "https://www.douyin.com/video/xxxxx",
      "schedule": "0 */2 * * *",
      "metrics": ["likes", "comments", "shares", "views"],
      "alert_threshold": {
        "likes": {"increase_percent": 50, "min_value": 1000},
        "comments": {"increase_percent": 30, "min_value": 100}
      }
    },
    {
      "id": "task_002",
      "name": "竞品B-小红书监控",
      "platform": "xiaohongshu",
      "url": "https://www.xiaohongshu.com/explore/xxxxx",
      "schedule": "0 */4 * * *",
      "metrics": ["likes", "collections", "comments"],
      "alert_threshold": {
        "likes": {"increase_percent": 100, "min_value": 500}
      }
    }
  ]
}

第二步:启动监控服务

# 启动监控服务
python scripts/monitor_service.py --config assets/config/monitor_tasks.json

# 后台运行
nohup python scripts/monitor_service.py --config assets/config/monitor_tasks.json > monitor.log 2>&1 &

第三步:异常检测与提醒

当检测到数据异常时:

  1. 自动截图保存到 assets/screenshots/
  2. 发送提醒通知
  3. 记录异常日志

监控配置说明

配置文件结构

{
  "tasks": [
    {
      "id": "任务ID",
      "name": "任务名称",
      "platform": "平台类型",
      "url": "监控页面URL",
      "schedule": "定时规则(cron格式)",
      "metrics": ["监控指标列表"],
      "selectors": {
        "likes": "点赞数CSS选择器",
        "comments": "评论数CSS选择器"
      },
      "alert_threshold": {
        "指标名": {
          "increase_percent": "增长率阈值(%)",
          "min_value": "最小触发值"
        }
      },
      "screenshot_on_alert": true,
      "notification": {
        "email": ["[email protected]"],
        "webhook": "https://oapi.dingtalk.com/robot/send?access_token=xxx"
      }
    }
  ],
  "global": {
    "data_retention_days": 30,
    "screenshot_retention_days": 7,
    "default_schedule": "0 */6 * * *"
  }
}

平台预设配置

Skill内置了常见平台的CSS选择器预设:

平台 点赞 评论 分享/转发 播放量/浏览
抖音 .like-count .comment-count .share-count .play-count
小红书 .like-count .comment-count .collect-count -
微博 .like-count .comment-count .repost-count .read-count
B站 .like-count .comment-count .coin-count .view-count
淘宝 - .rate-count - .sell-count

定时规则(Cron格式)

* * * * *
│ │ │ │ │
│ │ │ │ └─── 星期 (0-7, 0和7都是周日)
│ │ │ └───── 月份 (1-12)
│ │ └─────── 日期 (1-31)
│ └───────── 小时 (0-23)
└─────────── 分钟 (0-59)

示例:
0 */2 * * *    # 每2小时
0 9,18 * * *   # 每天9点和18点
0 */6 * * 1-5  # 工作日每6小时

异常检测规则

检测类型

  1. 增长率检测

    • 检测指标增长率是否超过阈值
    • 示例:点赞数2小时内增长超过50%
  2. 绝对值检测

    • 检测指标是否达到某个绝对值
    • 示例:评论数超过1000
  3. 趋势检测

    • 检测数据是否呈现异常趋势
    • 示例:连续3次采集数据持续上升
  4. 爆款检测

    • 综合多指标判断是否为爆款
    • 示例:点赞+评论+分享同时暴增

阈值配置示例

{
  "alert_threshold": {
    "likes": {
      "increase_percent": 50,
      "min_value": 1000,
      "window": "2h"
    },
    "comments": {
      "increase_percent": 30,
      "min_value": 100
    },
    "views": {
      "increase_percent": 100,
      "min_value": 10000
    }
  },
  "burst_detection": {
    "enabled": true,
    "min_metrics": 2,
    "threshold": {
      "likes": 5000,
      "comments": 500,
      "shares": 1000
    }
  }
}

通知方式

邮件通知

{
  "notification": {
    "email": {
      "smtp_server": "smtp.qq.com",
      "smtp_port": 587,
      "username": "[email protected]",
      "password": "your_auth_code",
      "to": ["[email protected]"]
    }
  }
}

钉钉机器人

{
  "notification": {
    "dingtalk": {
      "webhook": "https://oapi.dingtalk.com/robot/send?access_token=xxx",
      "secret": "your_secret"
    }
  }
}

飞书机器人

{
  "notification": {
    "feishu": {
      "webhook": "https://open.feishu.cn/open-apis/bot/v2/hook/xxx"
    }
  }
}

企业微信

{
  "notification": {
    "wecom": {
      "webhook": "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxx"
    }
  }
}

数据存储

数据文件结构

assets/data/
├── raw/                    # 原始抓取数据
│   ├── task_001/
│   │   ├── 2024-01-15.json
│   │   └── 2024-01-16.json
│   └── task_002/
├── processed/              # 处理后数据
│   └── trends/
└── alerts/                 # 异常记录
    └── 2024-01-16.json

数据格式

{
  "task_id": "task_001",
  "timestamp": "2024-01-16T10:00:00",
  "url": "https://...",
  "data": {
    "likes": 15234,
    "comments": 892,
    "shares": 3456,
    "views": 125000
  },
  "changes": {
    "likes": {"value": 1234, "percent": 8.8},
    "comments": {"value": 89, "percent": 11.1}
  },
  "alert_triggered": false
}

使用方法

快速开始

  1. 复制配置文件
cp assets/config/monitor_tasks.example.json assets/config/monitor_tasks.json
  1. 编辑配置
vim assets/config/monitor_tasks.json
  1. 启动监控
python scripts/monitor_service.py start

命令行工具

# 添加监控任务
python scripts/monitor_cli.py add --name "竞品A" --url "https://..." --platform douyin

# 列出所有任务
python scripts/monitor_cli.py list

# 手动执行一次监控
python scripts/monitor_cli.py run --task task_001

# 查看监控数据
python scripts/monitor_cli.py data --task task_001 --days 7

# 生成趋势报告
python scripts/monitor_cli.py report --task task_001 --output report.html

# 停止监控服务
python scripts/monitor_service.py stop

单次监控任务

# 单次抓取数据
python scripts/scraper.py --url "https://..." --platform douyin --output data.json

# 带截图
python scripts/scraper.py --url "https://..." --platform douyin --screenshot

技术实现

依赖安装

pip install playwright schedule pandas requests
playwright install chromium

核心模块

模块 功能
scraper.py 网页数据抓取
detector.py 异常检测算法
notifier.py 通知发送
scheduler.py 定时任务调度
storage.py 数据存储管理
monitor_service.py 监控服务主程序

注意事项

  1. 合规性:请遵守各平台的robots协议和使用条款
  2. 频率控制:避免过于频繁的抓取,建议间隔不小于1小时
  3. 反爬处理:部分平台可能有反爬机制,需要适当调整
  4. 数据隐私:注意保护抓取的数据,不要泄露敏感信息
  5. 稳定性:建议将监控服务部署在稳定的服务器上

文件结构

competitor-monitor/
├── SKILL.md                    # Skill主文件
├── README.md                   # 使用说明
├── INSTALL_GUIDE.md            # 安装指南
├── install.sh                  # 安装脚本
├── scripts/
│   ├── monitor_service.py      # 监控服务主程序
│   ├── monitor_cli.py          # 命令行工具
│   ├── scraper.py              # 数据抓取模块
│   ├── detector.py             # 异常检测模块
│   ├── notifier.py             # 通知模块
│   ├── scheduler.py            # 定时任务模块
│   ├── storage.py              # 数据存储模块
│   └── dashboard.py            # 数据可视化
├── assets/
│   ├── config/
│   │   ├── monitor_tasks.example.json  # 配置示例
│   │   └── platforms.json      # 平台预设配置
│   ├── screenshots/            # 截图存档
│   └── data/                   # 数据存档
└── references/
    └── PLATFORM_SELECTORS.md   # 平台选择器参考

示例场景

场景1:监控竞品抖音视频

{
  "id": "douyin_001",
  "name": "竞品抖音视频监控",
  "platform": "douyin",
  "url": "https://www.douyin.com/video/1234567890",
  "schedule": "0 */2 * * *",
  "metrics": ["likes", "comments", "shares"],
  "alert_threshold": {
    "likes": {"increase_percent": 50, "min_value": 5000}
  },
  "screenshot_on_alert": true
}

场景2:监控小红书爆款笔记

{
  "id": "xhs_001",
  "name": "小红书爆款监控",
  "platform": "xiaohongshu",
  "url": "https://www.xiaohongshu.com/explore/abcdef",
  "schedule": "0 */4 * * *",
  "metrics": ["likes", "collections", "comments"],
  "alert_threshold": {
    "likes": {"increase_percent": 100, "min_value": 1000},
    "collections": {"increase_percent": 80, "min_value": 500}
  },
  "burst_detection": {
    "enabled": true,
    "min_metrics": 2
  }
}

场景3:监控淘宝商品销量

{
  "id": "taobao_001",
  "name": "竞品销量监控",
  "platform": "taobao",
  "url": "https://item.taobao.com/item.htm?id=123456",
  "schedule": "0 9,18 * * *",
  "metrics": ["sell_count", "rate_count", "price"],
  "alert_threshold": {
    "sell_count": {"increase_percent": 30, "min_value": 100}
  }
}
Usage Guidance
This skill appears to be what it says: a web-scraping + anomaly-detection service that notifies via user-provided webhooks/email. Before installing or running it, consider: 1) Run the install and Python packages inside a virtual environment (venv) rather than system-wide pip to avoid polluting your global Python environment. 2) Keep notification credentials (SMTP password, webhook secrets) out of world-readable files — consider using a secrets manager or environment variables and edit the code/config to read them securely. 3) Deploy the service on a dedicated host (not a machine with sensitive data) because it downloads browser binaries and stores screenshots/data locally. 4) Set sensible scraping schedules and respect target sites' robots / terms of service to avoid being blocked or causing legal/abuse issues. 5) Review the config and any webhook URLs you provide — the skill will POST alerts and attachments to whatever endpoints you configure, so ensure those endpoints are trusted. 6) If you need stronger assurance, run a code audit or execute in an isolated environment (container) first.
Capability Analysis
Type: OpenClaw Skill Name: competitor-monitor-ai Version: 1.0.0 The 'competitor-monitor-ai' skill is a legitimate tool designed for automated data scraping and monitoring of e-commerce and social media platforms (e.g., Douyin, Taobao, Bilibili). It uses Playwright for web automation, implements anomaly detection logic in `scripts/detector.py`, and provides notification capabilities via Email and various webhooks (DingTalk, Feishu, WeCom) in `scripts/notifier.py`. The installation script `install.sh` and the main service `scripts/monitor_service.py` perform standard operations consistent with the stated purpose, and no evidence of data exfiltration, malicious persistence, or prompt injection was found.
Capability Assessment
Purpose & Capability
The name/description (competitor monitoring) matches the included code: scraper.py implements Playwright-based page scraping for the listed platforms, detector.py performs anomaly/burst detection, notifier.py posts alerts to configured channels, and monitor_service.py wires scheduling, scraping, persistence, and notifications. Declared requirements in SKILL.md (Python, Playwright/Selenium, network) align with the code. There are no unrelated credentials or unexpected external services hard-coded.
Instruction Scope
SKILL.md and README instruct the agent/user to run the provided scripts, edit JSON task configs, and place credentials/webhook URLs in config. The runtime instructions and code access only the expected local paths (assets/data, assets/screenshots, config file) and network endpoints provided in task notification configs. The instructions do not ask the agent to read arbitrary system files or environment variables beyond the config files.
Install Mechanism
An install.sh is provided which installs Python packages globally (pip install playwright schedule requests pandas) and runs `playwright install chromium`, then copies the skill into a skills directory. This is a moderately invasive install (writes files to disk, downloads browser binaries). The sources used (PyPI and Playwright's browser installer) are standard but the script performs global installs instead of recommending a virtualenv—this is operationally notable but not malicious.
Credentials
The skill declares no required environment variables, which matches the repo. Notification and SMTP credentials are provided via the task configuration files (monitor_tasks.example.json). Storing webhook secrets, SMTP passwords, or API keys in plain JSON config is functional but risky; the skill does not attempt to access unrelated credentials or system secrets. Requesting no platform-level credentials is proportionate to its stated purpose, but users must supply notification/auth details in config (clearly sensitive).
Persistence & Privilege
always:false and the skill does not claim or implement any mechanism to modify other skills or system-wide agent settings. It installs files into a skills directory and writes its own data (assets/data, assets/screenshots). That level of persistence is expected for a monitoring service; no elevated platform privileges or 'always included' behavior are present.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install competitor-monitor-ai
  3. After installation, invoke the skill by name or use /competitor-monitor-ai
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
竞争对手监测工具的初步版本,具备强大的定时竞争对手数据监测功能。 - 为电子商务和社交平台(如抖音、淘宝、京东、小红书、微博、B站等)增加了定时数据抓取功能 - 支持通过JSON文件配置监控任务(URL、指标、计划、警报阈值) - 检测异常数据激增(例如,当产品因指标跃升而成为“爆款”) - 对检测到的异常自动进行截图和多渠道警报(电子邮件、飞书、钉钉、企业微信等) - 数据按保留策略存档;支持通过CLI和监控服务进行数据查询、趋势报告和批量监控 - 提供模块化的Python脚本用于抓取、警报、检测和计划;包含示例配置和选择器参考
Metadata
Slug competitor-monitor-ai
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is 竞品数据定时监控?

竞品数据定时监控Skill,定时访问指定电商或社交平台页面,抓取点赞、评论、销量等数据,检测数据异常波动(如出现爆款),自动截图并发送提醒通知。适用于竞品分析、市场监控、爆款发现等场景。 It is an AI Agent Skill for Claude Code / OpenClaw, with 101 downloads so far.

How do I install 竞品数据定时监控?

Run "/install competitor-monitor-ai" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is 竞品数据定时监控 free?

Yes, 竞品数据定时监控 is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does 竞品数据定时监控 support?

竞品数据定时监控 is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created 竞品数据定时监控?

It is built and maintained by rumu14 (@hwl1413520); the current version is v1.0.0.

💬 Comments