Scheduling
TrendRadar's scheduling system (Timeline) controls when the crawling, push, and analysis tasks run each day. You can get started quickly by picking a built-in preset template, or customize the schedule entirely.
Default behavior when scheduling is disabled
The scheduling system is off by default (
schedule.enabled: false). When disabled, the program runs the full pipeline on every execution: data collection + AI analysis + push notification, using the report.mode value from config.yaml as the report mode. The scheduling system's purpose is to use different behavior configurations at different times of day (e.g. incremental pushes during the day, a daily digest in the evening). If you don't need time-based behavior, you don't have to enable scheduling.Config file locations
The scheduling system involves two configuration files:
| File | Role | Must edit? |
|---|---|---|
config/config.yaml | Select a preset name in the schedule section and enable scheduling | Required |
config/timeline.yaml | Defines time periods, day plans, and the weekday mapping (edit it when using the custom preset) | Only when customizing |
Quick start
The simplest approach is to set a preset name in
config/config.yaml. You only need to change one field to enable the scheduling system:schedule:
enabled: true
preset: "morning_evening" # 修改这里选择预设Just replace the value of
preset with the preset name you want to use. Below are all the available preset templates.Preset templates
TrendRadar ships with 5 preset templates that cover most use cases. Pick the preset closest to your daily routine, then set the corresponding name in
config.yaml.Recommended choice
For most users,
morning_evening is all you need: push as soon as there is a new trending topic during the day, plus a daily summary in the evening. If you keep an unusual schedule, choose another preset or use custom to fully tailor it.Custom configuration
If the built-in presets don't meet your needs, set
preset to "custom", then edit the custom section at the bottom of config/timeline.yaml.once mechanism: execute only once per period
Each time period can use the
once configuration to control whether push/analysis runs only once within that period:evening_summary:
start: "20:00"
end: "22:00"
push: true
report_mode: "daily"
once:
analyze: true # Run AI analysis only once in this period
push: true # Push only once in this periodHow once deduplication works
once tracks execution status in the database, so restarting the program does not reset it. Deduplication works on a per-day basis -- it resets automatically when the date changes (after midnight).
once.push: true and once.analyze: true are two independent dimensions and do not affect each other.Switching keyword/interest files per period
Each time period can specify its own keyword file and AI interest file, allowing you to focus on different topics at different times:
periods:
morning_brief:
start: "08:00"
end: "10:00"
frequency_file: "tech.txt" # Use the tech keyword list in the morning
interests_file: "tech_ai.txt" # AI focuses on tech in the morning
report_mode: "incremental"
evening_summary:
start: "20:00"
end: "22:00"
frequency_file: "finance.txt" # Use the finance keyword list in the evening
interests_file: "finance.txt" # AI focuses on finance in the evening
report_mode: "daily"- Keyword files go in the
config/custom/keyword/directory - AI interest files go in the
config/custom/ai/directory - When not specified, the defaults
config/frequency_words.txtandconfig/ai_interests.txtare used
Things to note
Legacy configuration removed
Since v6.0.0, the legacy
push_window and analysis_window options have been removed. If you are upgrading from an older version, migrate the related configuration to the new schedule + timeline.yaml system.GitHub Actions timing precision
GitHub Actions cron scheduling has a +/- 15-minute drift, so each time period should span at least 2 hours to avoid tasks being skipped due to the drift. If you need more precise scheduling, the Docker deployment is recommended.
Visual configuration editor
TrendRadar provides an online visual editor that lets you edit the
timeline.yaml configuration intuitively in a weekly view. Visit: https://sansan0.github.io/TrendRadar/. You can drag to adjust time periods in the editor, then copy the generated configuration into your local file.