tangzijie716/dsh-info-sources ↗★ 0
dsh-info-sources
支持 API 和 RSS 的信息采集插件 适合需要从指定 JSON 接口或 RSS 订阅源批量采集并汇总信息的用户。
安装
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:tangzijie716/dsh-info-sources说明文档
阅读完整 README ↗使用用户覆盖层
用户覆盖层没有默认路径。每次需要使用时,必须显式传入 sourcesPath:
info_sources(sourcesPath="config/my-sources.json")
info_fetch(id="my-source", sourcesPath="config/my-sources.json")
info_collect(tag="news", sourcesPath="config/my-sources.json")
不传 sourcesPath 时,插件只使用包内的 config/sources.json,不会自动读取环境变量、用户目录或以前调用过的覆盖文件。相对路径以当前 DSH 会话工作区为基准。
配置示例
{
"version": 1,
"defaults": {
"method": "api-get",
"timeoutMs": 15000,
"limit": 20,
"headers": {
"Accept": "application/json, text/plain, */*"
}
},
"sources": [
{
"id": "example-api",
"label": "示例接口",
"method": "api-get",
"enabled": true,
"tags": ["news", "example"],
"url": "https://example.com/api/items",
"query": {
"language": "zh-CN"
},
"headers": {
"Authorization": "Bearer $ENV:EXAMPLE_TOKEN"
},
"select": {
"items": "data.items[]",
"itemsFallback": ["items[]"],
"title": "title",
"hot": "score",
"url": "url",
"originalUrl": "originalUrl",
"origin": "source.name",
"publishedAt": "publishedAt",
"summary": "summary",
"label": "category"
},
"limit": 20,
"timeoutMs": 15000
},
{
"id": "example-feed",
"label": "示例订阅",
"method": "rss",
"tags": ["news"],
"url": "https://example.com/feed.xml",
"limit": 20
}
]
}