feat: 通用采集+模板注入引擎:配置驱动多源采集,Jinja2 模板注入成文档,不绑定单机
This commit is contained in:
@@ -0,0 +1,74 @@
|
||||
# morning-digest 示例配置
|
||||
# 用 build.py 跑:python3 scripts/build.py --config config/morning-digest.yaml
|
||||
# 机器相关项(内部地址/脚本路径)一律走 ${ENV},不写死。
|
||||
|
||||
meta:
|
||||
name: morning-digest
|
||||
date_format: "%Y-%m-%d"
|
||||
|
||||
sources:
|
||||
# 国际要闻:the-news API,china + us 各前 5 条
|
||||
news:
|
||||
type: http_json
|
||||
url: "https://www.thehear.org/api/country-view/{country}"
|
||||
param_loop:
|
||||
key: country
|
||||
values: [china, us]
|
||||
items_path: headlines
|
||||
limit: 5
|
||||
map:
|
||||
title: "title|headline|name"
|
||||
url: "url|link"
|
||||
source: "sourceLabel|sourceName|{loop.country}"
|
||||
|
||||
# 社会热榜:DailyHotApi,weibo + zhihu 各前 10 条
|
||||
hot:
|
||||
type: http_json
|
||||
url: "${HOT_API}/{platform}"
|
||||
param_loop:
|
||||
key: platform
|
||||
values: [weibo, zhihu]
|
||||
items_path: data
|
||||
limit: 10
|
||||
map:
|
||||
title: "title|name"
|
||||
rank: "@index"
|
||||
platform: "{loop.platform}"
|
||||
|
||||
# GitHub Trending:复用 fetch_github_trending.py 直连官方页面
|
||||
github:
|
||||
type: command
|
||||
cmd: "python3 ${GITHUB_TRENDING_SCRIPT} {out}"
|
||||
items_from_file: "{out}"
|
||||
map:
|
||||
name: "name"
|
||||
desc: "desc"
|
||||
url: "url"
|
||||
lang: "lang"
|
||||
stars: "stars"
|
||||
stars_today: "stars_today"
|
||||
|
||||
# RSS 精选:复用 ak-rss-digest 的 fetch_today_feed_items.py
|
||||
rss:
|
||||
type: command
|
||||
cmd: "python3 ${RSS_SCRIPT} --format json --days 7 --limit 30"
|
||||
items_path: items
|
||||
map:
|
||||
title: "title"
|
||||
url: "link"
|
||||
summary: "summary"
|
||||
source: "feed_name"
|
||||
|
||||
# 科技动态:默认无;由 LLM 搜好结果注入(见 README)
|
||||
tech:
|
||||
type: static_json
|
||||
file: "${TECH_FILE}"
|
||||
optional: true
|
||||
map:
|
||||
title: "title"
|
||||
url: "url"
|
||||
summary: "summary"
|
||||
|
||||
render:
|
||||
template: "templates/digest.md"
|
||||
output: "/tmp/digest_today.md"
|
||||
Reference in New Issue
Block a user