wechat-search-collector
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese微信视频号搜索
WeChat Channels Search
约定
Agreements
统一安装与执行目录:。执行前先进入该目录:
~/.agents/skills/wechat-search-collector/bash
cd ~/.agents/skills/wechat-search-collector- 使用 执行设备操作;使用
android-adb从截图定位元素(不要用ai-vision)。dump-ui - 优先复用 的函数封装(
references/commands.md/ADB/VISION/TASK),避免REPORT漂移。cd - 产物目录:存在则写
TASK_ID,否则写~/.eval/<TASK_ID>/(文件名带时间戳)。~/.eval/debug/ - 结果采集与上报:使用 ;进入微信流程前必须
result-bitable-reporter,结束时必须collect-start+collect-stop。report
Unified installation and execution directory: . Navigate to this directory before execution:
~/.agents/skills/wechat-search-collector/bash
cd ~/.agents/skills/wechat-search-collector- Use to perform device operations; use
android-adbto locate elements from screenshots (do not useai-vision).dump-ui - Prioritize reusing function encapsulations in (
references/commands.md/ADB/VISION/TASK) to avoidREPORTdrift.cd - Output directory: If exists, write to
TASK_ID; otherwise, write to~/.eval/<TASK_ID>/(filename with timestamp).~/.eval/debug/ - Result collection and reporting: Use ; must execute
result-bitable-reporterbefore entering the WeChat process, and must executecollect-start+collect-stopupon completion.report
前置处理
Preprocessing
- 读取设备序列号:使用环境变量 (或
SerialNumber自行确认)。ADB devices - 准备输出目录:必须为数字;创建
TASK_ID。~/.eval/<TASK_ID>/ - 启动采集:执行 (见
REPORT collect-start --task-id <TASK_ID> --db-path ~/.eval/records.sqlite --table capture_results)。references/commands.md - 可选拉取任务:用 从飞书领取任务;按
TASK claim选择流程(综合页搜索 / 个人页搜索)。Scene
- Read device serial number: Use the environment variable (or confirm via
SerialNumber).ADB devices - Prepare output directory: must be a number; create
TASK_ID.~/.eval/<TASK_ID>/ - Start collection: Execute (see
REPORT collect-start --task-id <TASK_ID> --db-path ~/.eval/records.sqlite --table capture_results).references/commands.md - Optional task retrieval: Use to retrieve tasks from Feishu; select the process based on
TASK claim(Comprehensive Page Search / Personal Page Search).Scene
共享子流程:滚动结果到触底(每滑动 5 次检测一次)
Shared Subprocess: Scroll Results to Bottom (Check every 5 swipes)
目标:避免视觉误判,优先用 sqlite 增量判断是否还有新增。
capture_results- 进入某个关键词结果页后,记录基线 :
LAST_COUNTLAST_COUNT="$(REPORT stat --task-id <TASK_ID>)" - 循环执行直到触底:
- 滑动 5 次:(循环 5 次;每次滑动后随机等待 500~1000ms)
ADB -s <SERIAL> swipe 540 1800 540 400 --duration-ms 800 - 查询当前总行数:
CUR_COUNT="$(REPORT stat --task-id <TASK_ID>)" - 若 连续出现
CUR_COUNT == LAST_COUNT次(建议N),判定触底;否则更新N=3并继续。LAST_COUNT=CUR_COUNT
- 滑动 5 次:
- sqlite 判定不可用时,用 二值兜底(不确定必须判定为否),见
ai-vision assert。references/commands.md
Goal: Avoid visual misjudgment; prioritize using sqlite to incrementally determine if there are new entries.
capture_results- After entering a keyword result page, record the baseline :
LAST_COUNTLAST_COUNT="$(REPORT stat --task-id <TASK_ID>)" - Loop until reaching the bottom:
- Swipe 5 times: (loop 5 times; wait randomly for 500~1000ms after each swipe)
ADB -s <SERIAL> swipe 540 1800 540 400 --duration-ms 800 - Query current total count:
CUR_COUNT="$(REPORT stat --task-id <TASK_ID>)" - If occurs
CUR_COUNT == LAST_COUNTconsecutive times (recommendedN), judge as bottom reached; otherwise, updateN=3and continue.LAST_COUNT=CUR_COUNT
- Swipe 5 times:
- If sqlite judgment is unavailable, use as a binary fallback (must judge as no if uncertain), see
ai-vision assert.references/commands.md
综合页搜索流程
Comprehensive Page Search Process
适用于“在视频号综合页搜索单个或多个关键词并遍历结果”的需求。
Applicable to the requirement of "searching for single or multiple keywords on the WeChat Channels comprehensive page and traversing results."
1. 任务参数校验
1. Task Parameter Validation
- 任务信息必须提供搜索关键词(以逗号拆分为 )
KEYWORDS
- Task information must provide search keywords (split into by commas)
KEYWORDS
2. 启动微信
2. Launch WeChat
- 若当前已在微信内,先使用 的
android-adb命令返回手机桌面。back-home - 回到桌面后再启动微信。
- If currently in WeChat, first use the command of
back-hometo return to the phone's home screen.android-adb - Launch WeChat after returning to the home screen.
3. 进入 发现 -> 视频号
3. Enter Discover -> WeChat Channels
- 通过截图 + ai-vision 定位并点击 与
发现入口。视频号
- Locate and click the and
Discoverentries via screenshot + ai-vision.WeChat Channels
4. 进入搜索界面
4. Enter Search Interface
- 通过截图 + ai-vision 点击搜索框/放大镜进入搜索页;若被遮挡则先滑动后再定位。
- Click the search box/magnifying glass to enter the search page via screenshot + ai-vision; if blocked, swipe first then locate.
5. 依次输入关键词并触发搜索
5. Enter Keywords in Sequence and Trigger Search
- 对关键词列表 逐个执行:清空输入框 -> 输入关键词 -> 触发搜索。
KEYWORDS - 若未进入结果页,重试触发直到进入结果页。
- Execute for each keyword in the list: Clear input box -> Enter keyword -> Trigger search.
KEYWORDS - If not entering the result page, retry triggering until entering the result page.
6. 结果滚动到底并切换下一个关键词
6. Scroll Results to Bottom and Switch to Next Keyword
- 每个关键词的结果页都执行“结果滚动到底”的滑动循环。
- 对每个关键词执行“共享子流程:滚动结果到触底(每滑动 5 次检测一次)”。
- 确认触底后:点击搜索框确保输入框激活 -> 清空 -> 输入下一个关键词 -> 触发搜索,直到完成所有关键词的遍历。
- Execute the "scroll results to bottom" swipe loop for each keyword's result page.
- Execute the "Shared Subprocess: Scroll Results to Bottom (Check every 5 swipes)" for each keyword.
- After confirming reaching the bottom: Click the search box to ensure it's activated -> Clear -> Enter next keyword -> Trigger search, until all keywords are traversed.
7. 场景后置处理
7. Scene Post-Processing
- 当综合页搜索任务成功完成后,调用 ,实现盗版聚类筛查、子任务创建与 webhook 推送计划创建。
piracy-handler - 若综合页搜索流程失败或中断,不调用该编排器。
- After the comprehensive page search task is successfully completed, call to implement piracy clustering screening, subtask creation, and webhook push plan creation.
piracy-handler - If the comprehensive page search process fails or is interrupted, do not call this orchestrator.
个人页搜索流程
Personal Page Search Process
适用于“先进入某账号个人页,再在个人页内检索多个关键词并遍历结果”的需求。
Applicable to the requirement of "first entering an account's personal page, then searching for multiple keywords within the personal page and traversing results."
1. 任务参数校验
1. Task Parameter Validation
- 任务信息必须提供:账号名称()和搜索关键词(以逗号拆分为
ACCOUNT_NAME)KEYWORDS
- Task information must provide: Account name () and search keywords (split into
ACCOUNT_NAMEby commas)KEYWORDS
2. 启动微信
2. Launch WeChat
- 若当前已在微信内,先使用 的
android-adb命令返回手机桌面。back-home - 回到桌面后再启动微信。
- If currently in WeChat, first use the command of
back-hometo return to the phone's home screen.android-adb - Launch WeChat after returning to the home screen.
3. 进入 发现 -> 视频号
3. Enter Discover -> WeChat Channels
- 通过截图 + ai-vision 定位并点击 与
发现入口。视频号
- Locate and click the and
Discoverentries via screenshot + ai-vision.WeChat Channels
4. 进入搜索界面
4. Enter Search Interface
- 通过截图 + ai-vision 点击搜索框/放大镜进入搜索页;若被遮挡则先滑动后再定位。
- Click the search box/magnifying glass to enter the search page via screenshot + ai-vision; if blocked, swipe first then locate.
5. 搜索账号并进入个人页
5. Search Account and Enter Personal Page
- 输入账号名称 并触发搜索
ACCOUNT_NAME - 进入搜索结果后,若有目标账号则直接点击进入个人页
- 否则可先点击 Tab,然后在账号列表中点击目标账号进入个人页
账号
- Enter the account name and trigger the search
ACCOUNT_NAME - After entering the search results, if the target account exists, click directly to enter its personal page
- Otherwise, click the tab first, then click the target account in the account list to enter its personal page
Accounts
6. 在个人页依次搜索关键词
6. Search Keywords in Sequence on Personal Page
- 对关键词列表 逐个执行:先点击个人页搜索框确保输入框激活 -> 清空 -> 输入关键词 -> 触发搜索 -> 滑动结果到底。
KEYWORDS - 每个关键词的结果页都执行“结果滚动到底”的滑动循环。
- 对每个关键词执行“共享子流程:滚动结果到触底(每滑动 5 次检测一次)”。
- 每个关键词搜索前确认仍在该账号个人页;若误退出则重进个人页后继续。
- Execute for each keyword in the list: First click the personal page search box to ensure it's activated -> Clear -> Enter keyword -> Trigger search -> Scroll results to bottom.
KEYWORDS - Execute the "scroll results to bottom" swipe loop for each keyword's result page.
- Execute the "Shared Subprocess: Scroll Results to Bottom (Check every 5 swipes)" for each keyword.
- Confirm being on the account's personal page before searching each keyword; if accidentally exited, re-enter the personal page then continue.
7. 场景后置处理
7. Scene Post-Processing
- 个人页任务结束并进入终态()后,若任务存在
success/error,调用GroupID做“是否就绪 + webhook 推送”。group-webhook-dispatch
- After the personal page task ends and enters the final state (), if the task has a
success/error, callGroupIDto perform "readiness check + webhook push".group-webhook-dispatch
任务结束后的收尾逻辑
Post-Task Cleanup Logic
- 若 未获取任务,直接结束不做收尾。
claim - 所有关键词遍历完成后,使用 的
android-adb命令返回手机桌面back-home - 无论任务成功、失败或中断,都必须执行以下动作(finally 语义):
- 调用 的
result-bitable-reporter结束当前设备采集,并打印采集统计。collect-stop - 调用 的
result-bitable-reporter,并带report,仅上报当前任务在--task-id <TASK_ID>中capture_results的数据到飞书多维表格采集结果表。reported in (0,-1)
- 调用
- 调用 更新该
feishu-bitable-task-manager的字段:TaskID->Status(基于任务执行结果)、success/failed/error->EndAtnow
- If no task is retrieved via , end directly without cleanup.
claim - After all keywords are traversed, use the command of
back-hometo return to the phone's home screenandroid-adb - Regardless of whether the task succeeds, fails, or is interrupted, the following actions must be executed (finally semantics):
- Call of
collect-stopto end current device collection, and print collection statistics.result-bitable-reporter - Call of
reportwithresult-bitable-reporter, and only report data where--task-id <TASK_ID>inreported in (0,-1)of the current task to the Feishu Bitable collection results table.capture_results
- Call
- Call to update the fields of this
feishu-bitable-task-manager:TaskID->Status(based on task execution result),success/failed/error->EndAtnow
备注与排障
Notes and Troubleshooting
- 点击不准:重新截图,让 ai-vision 提供更精确坐标(不要改用 )。
dump-ui - 异常流程(弹窗遮挡或步骤卡住):先识别弹窗并关闭,再继续原步骤。处理命令见 。
references/commands.md - 任务超时限制:若单个任务执行时长超过 30 分钟,则终止执行,任务状态更新为 failed。
- Inaccurate clicks: Take a new screenshot to let ai-vision provide more precise coordinates (do not switch to ).
dump-ui - Abnormal processes (pop-up blockage or step stuck): First identify and close the pop-up, then continue with the original step. See for processing commands.
references/commands.md - Task timeout limit: If the execution time of a single task exceeds 30 minutes, terminate execution and update the task status to failed.