WeChat Search Skill
Search for WeChat Official Account (微信公众号) articles using a compliant, two-layer approach that prioritizes legal search APIs and falls back to respectful web scraping when needed.
Features
- - Compliant Design: Prioritizes legal search APIs, respects robots.txt and rate limits
- Two-Layer Strategy:
- Primary: Web search with
site:mp.weixin.qq.com filter
- Fallback: Direct page fetching with proper delays and headers
- - Recent Results: Returns the 5 most recent articles by default (configurable)
- Time Filtering: Support for date range and recency filters
- Multiple Output Formats: Text, JSON, and markdown formats available
Prerequisites
- - OpenClaw Web Tools: Requires
web_search and web_fetch tools to be available - Tavily API Key (optional): For enhanced search capabilities via Tavily integration
Usage
Basic Search
CODEBLOCK0
Advanced Options
CODEBLOCK1
Configuration
Create
~/.openclaw/wechat-search-config.json to customize behavior:
CODEBLOCK2
Compliance & Ethics
- - Respects robots.txt: Checks and follows robots.txt directives
- Rate limiting: Minimum 5-second delay between requests
- Transparent identification: Clear User-Agent string identifying the bot
- Public content only: Only accesses publicly available articles
- No data retention: Does not store full article content, only metadata
Error Handling
- - Automatic retry on network failures (up to 3 attempts)
- Graceful fallback between search strategies
- Clear error messages for debugging
Future Enhancements
- - RSS feed integration support
- Article content summarization
- Author/subscription management
- Enhanced filtering options
This skill is designed to be both useful and responsible, providing access to valuable WeChat Official Account content while respecting platform rules and legal requirements.
微信搜索技能
使用合规的双层方法搜索微信公众号文章,优先使用合法搜索API,必要时回退至合规的网络爬取。
功能特点
- - 合规设计:优先使用合法搜索API,遵守robots.txt和速率限制
- 双层策略:
- 主要方式:使用site:mp.weixin.qq.com过滤器的网页搜索
- 备用方式:使用适当延迟和请求头的直接页面抓取
- - 最新结果:默认返回5篇最新文章(可配置)
- 时间筛选:支持日期范围和时效性筛选
- 多种输出格式:支持文本、JSON和Markdown格式
前置条件
- - OpenClaw网络工具:需要websearch和webfetch工具可用
- Tavily API密钥(可选):通过Tavily集成增强搜索能力
使用方法
基础搜索
bash
wechat-search 人工智能
高级选项
bash
返回10条结果(默认5条)
wechat-search 机器学习 --max-results 10
搜索过去一周内容
wechat-search 大模型 --past-week
自定义日期范围
wechat-search AI应用 --from 2026-01-01 --to 2026-02-01
JSON输出格式
wechat-search 开源AI --output json
强制使用网页抓取策略
wechat-search 最新技术 --strategy web_fetch
配置说明
创建~/.openclaw/wechat-search-config.json文件自定义行为:
json
{
defaultMaxResults: 5,
maxResultsLimit: 20,
requestDelayMs: 5000,
cacheDurationHours: 1,
userAgent: OpenClaw-WeChat-Search-Bot/1.0 (+https://github.com/your-username/wechat-search-skill)
}
合规与伦理
- - 遵守robots.txt:检查并遵循robots.txt指令
- 速率限制:请求间至少间隔5秒
- 透明标识:使用清晰的User-Agent字符串标识机器人身份
- 仅限公开内容:仅访问公开可获取的文章
- 不留存数据:不存储完整文章内容,仅保留元数据
错误处理
- - 网络故障自动重试(最多3次)
- 搜索策略间优雅回退
- 清晰的错误信息便于调试
未来增强
- - RSS订阅集成支持
- 文章内容摘要
- 作者/订阅管理
- 增强筛选选项
该技能旨在既实用又负责任,在遵守平台规则和法律要求的前提下,提供有价值的微信公众号内容访问。