Common fetcher

From huangruiteng/CS-Notes · View interactive version

Common fetcher is an AI agent skill from the GitHub repository huangruiteng/CS-Notes. 统一采集框架 - 支持 RSS/Web/API,207+ 采集源,AI 评分/分类/摘要

How to use this skill

Skill file

Common-Fetcher

统一采集框架,为 AI Agent 提供强大的信息采集能力。

功能特性

支持的行业

🏭 煤炭行业(27 个采集源)

🏠 房地产行业(23 个采集源)

🤖 AI 技术(129 个采集源)

使用方法

CLI 方式

# 抓取煤炭行业数据
common-fetcher --industry coal --output daily.md

# 抓取房地产行业数据
common-fetcher --industry realestate --output daily.md

# 抓取 AI 技术数据
common-fetcher --industry ai --output daily.md

# 自定义采集源
common-fetcher --config custom-sources.json --output daily.md

Node.js API

import { CommonFetcher } from 'common-fetcher';

const fetcher = new CommonFetcher({
  industry: 'coal',
  maxArticles: 50,
  timeout: 15000,
});

const result = await fetcher.fetch();
console.log(`成功抓取 ${result.totalArticles} 篇文章`);

OpenClaw 集成

在 openclaw.json 中配置:

{
  "skills": {
    "common-fetcher": {
      "enabled": true,
      "industry": "coal",
      "schedule": "0 8 * * *"
    }
  }
}

架构设计

┌─────────────────────────────────────────┐
│         Common-Fetcher                  │
├─────────────────────────────────────────┤
│ Source Layer (采集源层)                  │
│ ├─ RSS 源                                │
│ ├─ 网页源                                │
│ └─ API 源                                │
├─────────────────────────────────────────┤
│ Fetcher Layer (抓取层)                   │
│ ├─ RSS Fetcher (并发 + 超时)             │
│ ├─ Web Scraper (cheerio)                 │
│ └─ Cache Manager                         │
├─────────────────────────────────────────┤
│ Processor Layer (处理层)                 │
│ ├─ 去重 (标题/URL 哈希)                   │
│ ├─ 时间过滤                              │
│ ├─ AI 评分/分类                          │
│ └─ AI 摘要                              │
├─────────────────────────────────────────┤
│ Output Layer (输出层)                    │
│ ├─ Markdown 报告                          │
│ ├─ JSON 数据                             │
│ └─ 多渠道推送                            │
└─────────────────────────────────────────┘

性能指标

| 解析器 | 文章数/次 | 耗时 | 成功率 |

|--------|-----------|------|--------|

| 观点地产网 | 30 篇 | 605ms | 100% |

| 煤炭资源网 | 30 篇 | 455ms | 100% |

| 房天下 | 17 篇 | 579ms | 100% |

| MIT Tech Review | 9 篇 | 393ms | 100% |

| 总计 | 86 篇/次 | ~2s | 100% |

配置说明

采集源配置

在 config/ 目录下管理采集源:

解析器开发

自定义解析器参考 src/parsers/ 目录:

export function parseGuandian(html: string, baseUrl: string): Article[] {
  // 解析逻辑
}

开发计划

已实现 ✅

进行中 🔄

计划中 ⏳

贡献指南

欢迎提交 Issue 和 PR!

  1. Fork 项目
  2. 创建特性分支
  3. 提交改动
  4. 推送到分支
  5. 创建 Pull Request

许可证

MIT License

联系方式


Common-Fetcher - 为 AI Agent 提供强大的信息采集能力 🕸️

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.