Install
openclaw skills install wechat-articles-spiderWeChat Official Account article crawler with x402 micropayments. Requires Chrome browser and interactive WeChat QR login on first use. Harvest articles for r...
openclaw skills install wechat-articles-spider微信公众号文章爬虫 - x402 支付版
支持实时支付(小额)和异步支付(大额)混合模式,使用 Base 链 USDC 支付。
Use this skill when you need to:
| 计费模式 | 价格 | 说明 |
|---|---|---|
| 按篇 | $0.1 USDC/篇 | 适合少量精准获取 |
| 按号 | $10 USDC/号 | 批量获取某号全部历史文章 |
| 包月 | $100 USDC/月 | 30天无限使用 |
| 免费 | 10篇 | 新用户免费体验 |
export USER_ID="0xYourWalletAddress"
python3 spider_cli.py status --user $USER_ID
python3 spider_cli.py crawl --user $USER_ID --account 机器之心 --max 5 --mode free
python3 spider_cli.py crawl --user $USER_ID --account 机器之心 --max 20
# System prompts payment of $2 USDC
# Complete transfer and enter transaction hash
python3 spider_cli.py crawl --user $USER_ID --account 机器之心 --max 100 --mode async
# Pay $10 USDC, task enters queue for background processing
python3 spider_cli.py status TASK-1711523456-7890
python3 spider_cli.py subscribe --user $USER_ID
# Pay $100 USDC for 30 days unlimited usage
User requests crawl → System calculates price →
├─ <$5 → Real-time payment → User transfers → Confirm → Crawl immediately
└─ ≥$5 → Async payment → User transfers → Confirm → Add to queue → Background crawl → Notify completion
wechat_articles_spider/
├── SKILL.md # This documentation
├── config.py # Configuration (pricing, receiving address)
├── spider_cli.py # CLI entry point
├── spider_api.py # API layer
├── x402_core.py # x402 payment core
├── quota_manager.py # User quota management
├── async_queue.py # Async task queue
├── blockchain_verifier.py # On-chain verification
├── wechat_mp_crawler.py # Core crawler logic
├── requirements.txt # Python dependencies
└── data/ # Data storage
├── users/ # User data (quotas, subscriptions)
└── queue/ # Async task queue
Edit config.py to customize:
# Receiving address (already set)
RECEIVING_ADDRESS = "0x172444FC64e2E370fCcF297dB865831A1555b07A"
# Pricing (USDC)
PRICING = {
"per_article": 0.1,
"per_account": 10.0,
"monthly": 100.0,
}
# Async threshold
ASYNC_THRESHOLD = 5.0 # Use async for payments >= $5
pip install -r requirements.txt
Required: Python 3.8+, Google Chrome browser
$ python3 spider_cli.py crawl --user 0xNewUser --account 机器之心 --max 5 --mode free
🎁 Free quota: 10/10 articles
📅 Monthly subscription: ❌ Not active
🚀 Crawling 5 articles with free quota...
✅ Success!
Articles: 5
Cost: $0 USDC
Payment method: free
Remaining free quota: 5
$ python3 spider_cli.py crawl --user 0xUser --account 机器之心 --max 20
🎁 Free quota: 0/10 articles
📅 Monthly subscription: ❌ Not active
💳 Payment required: $2.0 USDC
Receiving address: 0x172444FC64e2E370fCcF297dB865831A1555b07A
Network: Base
Steps:
1. Open your wallet (MetaMask / Coinbase Wallet)
2. Switch to Base network
3. Send $2.0 USDC to: 0x172444FC64e2E370fCcF297dB865831A1555b07A
4. Copy transaction hash
Enter transaction hash (0x...): 0xabc123...
✅ Success!
Articles: 20
Cost: $2.0 USDC
Payment method: x402
Transaction: 0xabc123...
$ python3 spider_cli.py crawl --user 0xUser --account 机器之心 --max 200 --mode async
💳 Payment required: $10.0 USDC
...
Enter transaction hash (0x...): 0xdef456...
✅ Payment confirmed, task queued
Task ID: TASK-1711523456-7890
Check status with: status TASK-1711523456-7890
$ python3 spider_cli.py status TASK-1711523456-7890
📋 Task status: TASK-1711523456-7890
Account: 机器之心
Status: processing
...
# 10 minutes later
📋 Task status: TASK-1711523456-7890
Status: completed
Result: {"articles_count": 200}
"Transaction not found"
"Insufficient amount"
"Payment expired"
"WeChat login failed"
weixin_credentials.py and retry"No articles found"
"Account blocked"
"Chrome not found"
"ModuleNotFoundError: No module named 'selenium'"
pip install -r requirements.txt
"ChromeDriver version mismatch"
# webdriver-manager should auto-download, but if issues occur:
pip install --upgrade webdriver-manager
WeChat Account Risk
VPN Must Be Disabled
Rate Limiting
Base Chain Requirements
Enable on-chain verification for production:
# Using public RPC (free, rate-limited)
export X402_ONCHAIN_VERIFY=true
export BASE_NETWORK=mainnet
# Using Alchemy/Infura (recommended for production)
export X402_ONCHAIN_VERIFY=true
export BASE_NETWORK=mainnet
export BASE_API_KEY=your_alchemy_api_key
# Using BaseScan API
export X402_ONCHAIN_VERIFY=true
export USE_BASESCAN=true
export BASE_API_KEY=your_basescan_api_key
0x172444FC64e2E370fCcF297dB865831A1555b07A before sending paymentsdata/ directoryweixin_credentials.py; keep this file secureThe skill stores data in the following locations (relative to skill directory):
~/.wechat_article_crawler/
├── weixin_credentials.py # WeChat login tokens (sensitive)
└── data/
├── users/ # User quotas and subscriptions
│ └── {user_id}.json
└── queue/ # Async task queue
└── tasks.json
status TASK-IDweixin_credentials.py allows 24hr re-accesscurl ipinfo.io if unsuredata/queue/tasks.json for failed task detailsMIT License - For educational and research purposes only
x402 Powered ⚡️ Programmatic payments via x402 protocol on Base