Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@
- DeepL
- 兼容所有支持 OpenAI 接口的模型

## 当前代码结构

- `core/models`:数据结构与最基本模型行为
- `core/services/feed`:更新、刷新、过滤、输出
- `core/services/admin`:后台动作与批量修改
- `core/services/agent`:各类 Agent 的具体执行逻辑
- `core/services/opml.py`:OPML 导入导出
- `core/views.py` / `core/actions.py` / `core/management/commands`:入口层

## 赞助

感谢以下公司为本项目提供的开源支持。
Expand Down
9 changes: 9 additions & 0 deletions README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ Supported translation engines:

More engines coming soon.

## Current Code Structure

- `core/models`: data structures and minimal model behavior
- `core/services/feed`: update, refresh, filtering, and output logic
- `core/services/admin`: admin actions and batch modification
- `core/services/agent`: concrete agent implementations
- `core/services/opml.py`: OPML import/export
- `core/views.py` / `core/actions.py` / `core/management/commands`: entry layer

## Sponsors

Thanks to the following companies for their open-source support.
Expand Down
15 changes: 0 additions & 15 deletions config/rt_cron
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,6 @@
# 每周一凌晨2点执行一次 feed_updater_for_frequency 任务
0 2 * * 1 root cd /app && /opt/venv/bin/python manage.py feed_updater --frequency 'weekly' >> /var/log/cron.log 2>&1

# 每周一凌晨2点10分执行一次 digest 生成任务 (monday)
10 2 * * 1 root cd /app && /opt/venv/bin/python manage.py digest_generator --publish-days monday >> /var/log/cron.log 2>&1
# 每周二凌晨2点10分执行一次 digest 生成任务 (tuesday)
10 2 * * 2 root cd /app && /opt/venv/bin/python manage.py digest_generator --publish-days tuesday >> /var/log/cron.log 2>&1
# 每周三凌晨2点10分执行一次 digest 生成任务 (wednesday)
10 2 * * 3 root cd /app && /opt/venv/bin/python manage.py digest_generator --publish-days wednesday >> /var/log/cron.log 2>&1
# 每周四凌晨2点10分执行一次 digest 生成任务 (thursday)
10 2 * * 4 root cd /app && /opt/venv/bin/python manage.py digest_generator --publish-days thursday >> /var/log/cron.log 2>&1
# 每周五凌晨2点10分执行一次 digest 生成任务 (friday)
10 2 * * 5 root cd /app && /opt/venv/bin/python manage.py digest_generator --publish-days friday >> /var/log/cron.log 2>&1
# 每周六凌晨2点10分执行一次 digest 生成任务 (saturday)
10 2 * * 6 root cd /app && /opt/venv/bin/python manage.py digest_generator --publish-days saturday >> /var/log/cron.log 2>&1
# 每周日凌晨2点10分执行一次 digest 生成任务 (sunday)
10 2 * * 0 root cd /app && /opt/venv/bin/python manage.py digest_generator --publish-days sunday >> /var/log/cron.log 2>&1

# 每周运行一次 清理entreis 任务
0 3 * * 1 root cd /app && /opt/venv/bin/python manage.py clean_entries >> /var/log/cron.log 2>&1

100 changes: 12 additions & 88 deletions config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@
from django.core.management.utils import get_random_secret_key
import os
import sys
from core.prompts import (
DEFAULT_CONTENT_TRANSLATE_PROMPT,
DEFAULT_FILTER_PROMPT,
DEFAULT_SUMMARY_PROMPT,
DEFAULT_TITLE_TRANSLATE_PROMPT,
OUTPUT_FORMAT_FOR_FILTER_PROMPT,
)

SITE_URL = os.environ.get("SITE_URL", "http://localhost:8000")
USER_MANAGEMENT = os.environ.get("USER_MANAGEMENT") == "1"
Expand Down Expand Up @@ -280,91 +287,8 @@
},
}

default_title_translate_prompt = "You are a professional, authentic translation engine. Translate only the text into {target_language}, return only the translations, do not explain the original text."
default_content_translate_prompt = """
You are a professional, authentic translation engine specialized in HTML content translation.

Requirements:
1. Translate only the text content into {target_language}
2. Preserve ALL HTML tags, attributes, and structure completely unchanged
3. Maintain proper context awareness across different HTML elements and their relationships
4. Consider semantic meaning within nested tags and their hierarchical context
5. Ensure translated text fits naturally within the HTML structure
6. Keep inline elements (like <span>, <a>, <strong>) contextually coherent with their surrounding text
7. Maintain consistency in terminology throughout the entire HTML document
8. Return only the translated HTML content without explanations or comments

Important: Do not modify, remove, or alter any HTML tags, attributes, classes, IDs, or structural elements. Only translate the actual text content between tags.

"""
default_summary_prompt = (
"Summarize the following text in {target_language} and return markdown format."
)

default_digest_prompt = """
You are an editor-in-chief and expert analyst. Create a concise, objective, and well-structured daily digest from multiple articles.

OUTPUT FORMAT
3–5 categories (auto-generated, short topic names):
- Header: ## {category}
- Keep only the most important articles in this category
- For each kept article:
- **[Title](LINK_X)**
> 1–2 sentences, present tense, active voice; highlight novel results/decisions/metrics/impacts; avoid repeated phrasing.

Selection policy (apply strictly):
- Prioritize significance and real-world impact (e.g., regulatory decisions, major launches, security incidents, funding/M&A, peer-reviewed findings)
- Prioritize novelty; ignore incremental or routine updates and marketing/promotional posts
- Prefer credible, primary sources; avoid rumors/speculation
- Deduplicate across sources; if multiple items cover the same event, keep the most comprehensive one and drop the rest
- If a category has no important items, skip the category entirely

General rules:
- Maintain a neutral, objective tone; no content beyond the provided texts
- Extract facts, named entities, numbers, dates, and concrete outcomes
- Vary wording across items to avoid repetition
- Title rewrite (each item): rewrite into {target_language} objectively (no hype/clickbait/exclamations). Do NOT copy source wording; always paraphrase into a concise, neutral title even if the source is already in {target_language}.
"""

output_format_for_digest_prompt = """

**OUTPUT FORMAT**
- All headers, titles, and summaries must be in {target_language}.
- Return ONLY the digest content in the markdown format
- Use the exact LINK_X placeholders. Do not modify, replace, add, or remove links. Keep the format **[Title](LINK_X)**.
- Do NOT add any explanatory notes, disclaimers, or meta-commentary
- Do NOT provide usage instructions or suggestions
"""

default_filter_prompt = """
You are an advanced RSS content curator. Analyze the article following these protocols:

1. **Cross-article Deduplication**:
- Identify duplicate content using semantic similarity
- For duplicate sets:
• Keep the most comprehensive version

2. **Ad Exclusion**:
• Discard if any detected:
- Promotional language patterns
- Affiliate links
- Brand mentions >5% of content
- "Sponsored" disclosure

3. **Clickbait Detection**
Discard if headline:
- Uses sensational punctuation (e.g., "SHOCKING!", "You won't BELIEVE...")
- Poses unanswered questions ("What happened next?")
- Employs urgency/scarcity tactics ("Act NOW!")
"""

output_format_for_filter_prompt = """

**Output Requirements**
• Only return "Passed" or "Blocked" based on the above checks.
• ABSOLUTELY NO:
- Explanations
- Metadata
- Discarded IDs
- Additional text
"""
default_title_translate_prompt = DEFAULT_TITLE_TRANSLATE_PROMPT
default_content_translate_prompt = DEFAULT_CONTENT_TRANSLATE_PROMPT
default_summary_prompt = DEFAULT_SUMMARY_PROMPT
default_filter_prompt = DEFAULT_FILTER_PROMPT
output_format_for_filter_prompt = OUTPUT_FORMAT_FOR_FILTER_PROMPT
Loading
Loading