Rental Reporter Skill
使用流程
1. 收录投稿
当用户提供小红书链接或粘贴投稿内容时:
Step 1: 解析内容
- 如果是链接:使用 kimi_fetch 工具获取页面内容
- 如果是粘贴文本:直接处理
Step 2: AI结构化 将内容解析为以下JSON格式:
{
"source_url": "原始链接(如有)",
"raw_content": "原始投稿全文",
"district": "区域名称(如:成华区)",
"neighborhood": "小区/地段名称(如:成量十六号院)",
"event_type": "事件类型摘要(如:欺诈签约后失联拒退)",
"risk_level": "high|medium|low",
"summary": "AI生成的摘要(100字以内)",
"advice": "给租客的应对建议",
"amount_involved": "涉及金额(可选)",
"tags": ["欺诈签约", "失联拒退", "一房多租"]
}
Step 3: 保存到数据库
python ~/.openclaw/workspace/skills/rental-reporter/scripts/parse_submission.py \
--json '<上面的JSON>'
Step 4: 确认收录
返回给用户:小区名、风险等级、标签、建议。状态为 pending,等待人工复核。
2. 人工复核
每周审核 pending 状态的投稿:
# 生成待审核队列报告
python ~/.openclaw/workspace/skills/rental-reporter/scripts/generate_report.py \
--type pending --output /tmp/openclaw/pending.html
在Python中操作:
from scripts.db_helper import RentalDB
with RentalDB() as db:
# 查看待审核列表
pending = db.get_pending_submissions(limit=20)
# 审核通过
db.approve_submission(1, notes="内容真实,可发布")
# 审核拒绝
db.reject_submission(2, notes="信息不足,无法核实")
3. 生成报告
支持的报告类型:
| 报告类型 | 命令 | 说明 | 输出格式 |
|----------|------|------|----------|
| 小区热度排行 | --type ranking | Top20小区避坑热度排行 | text/html/pdf |
| 区域风险报告 | --type district --district 成华区 | 指定区域的详细分析 | text/html/pdf |
| 数据总览 | --type stats | 整体统计、区域分布、高频标签 | text/html/pdf |
| 待审核队列 | --type pending | 待人工复核的投稿列表 | text |
默认输出纯文本格式(推荐,可直接复制粘贴到小红书):
python ~/.openclaw/workspace/skills/rental-reporter/scripts/generate_report.py \
--type stats
生成小红书风格的纯文本报告并保存:
python ~/.openclaw/workspace/skills/rental-reporter/scripts/generate_report.py \
--type ranking \
--format text \
--output /tmp/openclaw/report_ranking.txt
生成HTML报告:
python ~/.openclaw/workspace/skills/rental-reporter/scripts/generate_report.py \
--type stats \
--format html \
--output /tmp/openclaw/report_stats.html
生成PDF报告(需要安装weasyprint):
pip install weasyprint
python ~/.openclaw/workspace/skills/rental-reporter/scripts/generate_report.py \
--type stats \
--format pdf \
--output /tmp/openclaw/report_stats.pdf
4. 数据查询
from scripts.db_helper import RentalDB
with RentalDB() as db:
# 查区域统计
stats = db.get_district_stats()
# 查小区排行
ranking = db.get_neighborhood_stats(limit=10)
# 查标签统计
tags = db.get_tag_stats()
# 查最新投稿
subs = db.get_submissions(status='approved', limit=20)
# 查数据汇总
counts = db.get_counts()
数据库Schema
详见 references/schema.md
核心表:
submissions- 投稿主表(14个字段,极简设计)tags- 标签表(预置19个常用标签)submission_tags- 投稿标签关联reports- 报告记录
submissions 表字段
| 字段 | 类型 | 说明 | |------|------|------| | id | INTEGER | 自增主键 | | source_url | TEXT | 小红书链接 | | raw_content | TEXT | 原始投稿全文(必填) | | district | TEXT | 区域 | | neighborhood | TEXT | 小区 | | event_type | TEXT | 事件类型概括 | | risk_level | TEXT | high/medium/low | | summary | TEXT | AI摘要 | | advice | TEXT | 应对建议 | | amount_involved | TEXT | 涉及金额(文本) | | status | TEXT | pending/approved/rejected | | ai_reviewed | BOOLEAN | AI是否已初筛 | | human_verified | BOOLEAN | 人工是否复核 | | verifier_notes | TEXT | 审核备注 | | created_at | TIMESTAMP | 收录时间 | | updated_at | TIMESTAMP | 更新时间 |
标签体系
预置标签分类:
- fraud(欺诈类): 虚假房源、低价引流、二房东跑路、诈骗定金、租金贷
- contract(合同类): 合同欺诈、口头承诺不兑现、合同期内涨租、禁止转租
- facility(设施类): 违规隔断、甲醛超标、设施老化
- deduction(扣费类): 恶意扣押金、物业费隐瞒、虚假转让费
- agent(中介类): 中介费争议
- other(其他): 暴力清退、失联拒退、一房多租
AI解析时应根据内容自动匹配标签,也可新增标签。
设计原则
- 极简:无用户系统、无积分、无token、无惩罚
- 匿名:投稿人无需身份,内容靠信息价值驱动
- AI初筛+人工复核:AI做解析和初筛,人工做最终审核
- 隐私保护:不记录房东姓名、电话、具体房号
- 中性表述:避免"黑房东"等定性词汇
首次使用
需要先初始化数据库:
python ~/.openclaw/workspace/skills/rental-reporter/scripts/init_db.py
数据库位置:~/.openclaw/workspace/data/rental_reporter.db
Scan to join WeChat group