v1.3.0: 每源独立采集周期 + 定制监控与新闻监控分离(独立配置/独立汇总) + 历史采样留档与提取API
This commit is contained in:
+23
-1
@@ -106,7 +106,7 @@ def send_realtime(articles):
|
||||
|
||||
|
||||
def send_daily_summary(articles, window_label):
|
||||
"""每日汇总(默认每天10点):昨天至今的重要/相关资讯"""
|
||||
"""新闻机制:每日汇总(默认每天10点)——普通源的重要/相关资讯"""
|
||||
if not articles:
|
||||
return 0
|
||||
top = articles[: int(db.get_setting("max_summary_items", config.AUTO_DEFAULTS["max_summary_items"]))]
|
||||
@@ -133,3 +133,25 @@ def send_daily_summary(articles, window_label):
|
||||
if art and art.get("status") != "summarized":
|
||||
db.update_article(aid, status="summarized")
|
||||
return len(top)
|
||||
|
||||
|
||||
def send_custom_summary(articles, window_label):
|
||||
"""定制监控机制:独立汇总邮件——定制源在窗口内命中推送标准的资讯(单独配置/单独时间)"""
|
||||
if not articles:
|
||||
return 0
|
||||
top = articles[: int(db.get_setting("custom_max_summary_items",
|
||||
config.CUSTOM_DEFAULTS["custom_max_summary_items"]))]
|
||||
cards = "".join(_card(a) for a in top)
|
||||
subject = f"🎯 定制监控汇总 {window_label} · 命中{len(articles)}条"
|
||||
html = _html_wrap(
|
||||
"定制监控命中汇总",
|
||||
f"""
|
||||
<p style="color:#374151;font-size:13px;">汇总时段:{window_label}</p>
|
||||
<p style="color:#6b7280;font-size:12px;">以下为定制监控源中<b>达到推送标准</b>的资讯(由大模型按各源推送标准判定):</p>
|
||||
{cards}
|
||||
""",
|
||||
)
|
||||
send_email(subject, html)
|
||||
ids = [a["id"] for a in articles if a["id"]]
|
||||
db.add_log("custom_summary", subject, len(articles), ids, status="ok", detail=f"汇总{len(top)}条")
|
||||
return len(top)
|
||||
Reference in New Issue
Block a user