打分结束后通过 Bark 推送结果

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
fish
2026-05-02 23:11:03 +08:00
parent 3039bc97bf
commit b9975d6f91
2 changed files with 38 additions and 1 deletions

View File

@@ -1,7 +1,7 @@
import argparse
import sys
from . import fetcher, scorer, storage
from . import fetcher, notifier, scorer, storage
def run(ts_code: str) -> int:
@@ -62,6 +62,15 @@ def run(ts_code: str) -> int:
print(f" 持仓变化幅度: {ld['change_pct']:+.2f}%")
print(f"\n[OK] 数据已持久化到 SQLite")
push_title = f"{result.ts_code.split('.')[0]} {result.trade_date}"
push_body = (
f"综合 {result.composite:.1f}\n"
f"短期 {result.short_term:.1f} | 中期 {result.medium_term:.1f} | 长期 {result.long_term:.1f}\n"
f"{result.signal}"
)
if notifier.push_bark(push_title, push_body):
print("[Bark] 推送成功")
return 0