📦 sansan0 / TrendRadar

📄 config.yaml · 140 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140app:
  version_check_url: "https://raw.githubusercontent.com/sansan0/TrendRadar/refs/heads/master/version"
  show_version_update: true # 控制显示版本更新提示,如果 false,则不接受新版本提示

crawler:
  request_interval: 1000 # 请求间隔(毫秒)
  enable_crawler: true # 是否启用爬取新闻功能,如果 false,则直接停止程序
  use_proxy: false # 是否启用代理,false 时为关闭
  default_proxy: "http://127.0.0.1:10086"

# 🔸 daily(当日汇总模式)
#   • 推送时机:按时推送(默认每小时推送一次)
#   • 显示内容:当日所有匹配新闻 + 新增新闻区域
#   • 适用场景:日报总结、全面了解当日热点趋势
#
# 🔸 current(当前榜单模式)
#   • 推送时机:按时推送(默认每小时推送一次)
#   • 显示内容:当前榜单匹配新闻 + 新增新闻区域
#   • 适用场景:实时热点追踪、了解当前最火的内容
#
# 🔸 incremental(增量监控模式)
#   • 推送时机:有新增才推送
#   • 显示内容:新出现的匹配频率词新闻
#   • 适用场景:避免重复信息干扰

# 推送模式选择
report:
  mode: "daily" # 可选: "daily"|"incremental"|"current"
  rank_threshold: 5 # 排名高亮阈值
  sort_by_position_first: false # 排序优先级:true=先按配置位置排序,false=先按热点条数排序
  max_news_per_keyword: 0 # 每个关键词最大显示数量,0=不限制
  reverse_content_order: false # 内容顺序:false=热点词汇统计在前,true=新增热点新闻在前

notification:
  enable_notification: true # 是否启用通知功能,如果 false,则不发送手机通知
  message_batch_size: 4000 # 消息分批大小(字节)(这个配置别动)
  dingtalk_batch_size: 20000 # 钉钉消息分批大小(字节)(这个配置也别动)
  feishu_batch_size: 30000 # 飞书消息分批大小(字节)
  bark_batch_size: 4000 # Bark消息分批大小(字节)
  slack_batch_size: 4000 # Slack消息分批大小(字节)
  batch_send_interval: 3 # 批次发送间隔(秒)
  feishu_message_separator: "━━━━━━━━━━━━━━━━━━━" # feishu 消息分割线
  max_accounts_per_channel: 3 # 每个渠道最大账号数量,建议不超过 3

  # 🕐 推送时间窗口控制(可选功能)
  # 用途:限制推送的时间范围,避免非工作时间打扰
  # 适用场景:
  #   - 只想在工作日白天接收推送(如 09:00-18:00)
  #   - 希望在晚上固定时间收到汇总(如 20:00-22:00)
  push_window:
    enabled: false  # 是否启用推送时间窗口控制,默认关闭
    # 注意:GitHub Actions 执行时间不稳定,时间范围建议至少留足 2 小时
    # 如果想要精准的定时推送,建议使用 Docker 部署在个人服务器上
    time_range:
      start: "20:00"  # 推送时间窗口开始(北京时间)
      end: "22:00"    # 推送时间窗口结束(北京时间)
    once_per_day: true  # 每天在时间窗口内只推送一次,如果 false,则窗口内每次执行都推送
    push_record_retention_days: 7  # 推送记录保留天数

  # ⚠️⚠️⚠️ 重要安全警告 / IMPORTANT SECURITY WARNING ⚠️⚠️⚠️
  #
  # 🔴 请务必妥善保管好 webhooks,不要公开!!!
  # 🔴 如果你以 fork 的方式将本项目部署在 GitHub 上,请勿在下面填写任何 webhooks
  # 🔴 而是将 webhooks 填入 GitHub Secret(Settings → Secrets and variables → Actions)
  # 🔴 否则:
  #    - 轻则:手机上收到大量垃圾广告推送
  #    - 重则:webhook 被滥用造成严重安全隐患(如恶意消息轰炸、钓鱼链接等)
  #
  # 🔴 NEVER expose webhooks publicly!!!
  # 🔴 If deploying via GitHub fork, DO NOT fill webhooks below
  # 🔴 Instead, add them to GitHub Secrets (Settings → Secrets and variables → Actions)
  # 🔴 Consequences of exposure:
  #    - Minor: Spam notifications flooding your devices
  #    - Severe: Webhook abuse leading to security incidents (malicious messages, phishing links, etc.)
  #
  # ⚠️⚠️⚠️ 多账号推送说明 / MULTI-ACCOUNT PUSH NOTICE ⚠️⚠️⚠️
  #
  # 🔸 多账号支持:
  #   • 请使用分号(;)分隔多个账号,如:"url1;url2;url3"
  #   • 示例:telegram_bot_token: "token1;token2" 对应 telegram_chat_id: "id1;id2"
  #   • 对于需要配对的配置(如 Telegram 的 token 和 chat_id),数量必须一致
  #   • 每个渠道最多支持 max_accounts_per_channel 个账号(见上方配置)
  #   • 邮箱已支持多收件人(逗号分隔),保持不变
  #
  # 🔸 Multi-Account Support:
  #   • Use semicolon(;) to separate multiple accounts, e.g., "url1;url2;url3"
  #   • Example: telegram_bot_token: "token1;token2" with telegram_chat_id: "id1;id2"
  #   • For paired configs (e.g., Telegram token and chat_id), quantities must match
  #   • Each channel supports up to max_accounts_per_channel accounts (see above config)
  #   • Email already supports multiple recipients (comma-separated), unchanged
  #
  webhooks:
    feishu_url: "" # 飞书机器人的 webhook URL(多账号用 ; 分隔)
    dingtalk_url: "" # 钉钉机器人的 webhook URL(多账号用 ; 分隔)
    wework_url: "" # 企业微信机器人的 webhook URL(多账号用 ; 分隔)
    wework_msg_type: "markdown" # 企业微信消息类型:markdown(群机器人) 或 text(个人微信应用)
    telegram_bot_token: "" # Telegram Bot Token(多账号用 ; 分隔,需与 chat_id 数量一致)
    telegram_chat_id: "" # Telegram Chat ID(多账号用 ; 分隔,需与 bot_token 数量一致)
    email_from: "" # 发件人邮箱地址
    email_password: "" # 发件人邮箱密码或授权码
    email_to: "" # 收件人邮箱地址,多个收件人用逗号分隔
    email_smtp_server: "" # SMTP服务器地址(可选,留空自动识别)
    email_smtp_port: "" # SMTP端口(可选,留空自动识别)
    ntfy_server_url: "https://ntfy.sh" # ntfy服务器地址,默认使用公共服务,可改为自托管地址
    ntfy_topic: "" # ntfy主题名称(多账号用 ; 分隔)
    ntfy_token: "" # ntfy访问令牌(可选,用于私有主题,多账号用 ; 分隔)
    bark_url: "" # Bark推送URL(多账号用 ; 分隔,格式:https://api.day.app/your_device_key 或自建服务器地址)
    slack_webhook_url: "" # Slack Incoming Webhook URL(多账号用 ; 分隔,格式:https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX)

# 用于让关注度更高的新闻在更前面显示,即用算法重新组合不同平台的热搜排序形成你侧重的热搜,合起来是 1 就行
weight:
  rank_weight: 0.6 # 排名权重
  frequency_weight: 0.3 # 频次权重
  hotness_weight: 0.1 # 热度权重

# name 可以定义任意名称,只具有显示作用,即使项目运行了几天后,忽然改掉 name 也不会影响代码的正常运行
platforms:
  - id: "toutiao"
    name: "今日头条"
  - id: "baidu"
    name: "百度热搜"
  - id: "wallstreetcn-hot"
    name: "华尔街见闻"
  - id: "thepaper"
    name: "澎湃新闻"
  - id: "bilibili-hot-search"
    name: "bilibili 热搜"
  - id: "cls-hot"
    name: "财联社热门"
  - id: "ifeng"
    name: "凤凰网"
  - id: "tieba"
    name: "贴吧"
  - id: "weibo"
    name: "微博"
  - id: "douyin"
    name: "抖音"
  - id: "zhihu"
    name: "知乎"