daily-news-summarizer
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese每日新闻摘要生成器
Daily News Summary Generator
Overview
Overview
此技能使用浏览器自动化(Playwright MCP工具)访问新闻网站,智能提取当日重要新闻并生成详细摘要。每个新闻条目包含3-5句话的AI摘要,最终输出为格式化的Markdown报告。
This skill uses browser automation (Playwright MCP tool) to access news websites, intelligently extract important daily news and generate detailed summaries. Each news entry includes a 3-5 sentence AI summary, and the final output is a formatted Markdown report.
工作流程
Workflow
第1步:确定新闻源
Step 1: Determine News Sources
首先检查用户指定的新闻源。如果用户未指定,使用以下默认源:
中文新闻网站:
- 新浪新闻: https://news.sina.com.cn
- 网易新闻: https://news.163.com
- 腾讯新闻: https://news.qq.com
- 搜狐新闻: https://news.sohu.com
国际新闻网站:
- BBC News: https://www.bbc.com/news
- Reuters: https://www.reuters.com
- CNN: https://edition.cnn.com
科技新闻:
- 36氪: https://36kr.com
- 虎嗅: https://www.huxiu.com
如果用户有自定义配置文件 ,优先使用其中的配置。
~/.daily-news-config.yamlFirst, check the news sources specified by the user. If no sources are specified, use the following default sources:
Chinese News Websites:
- Sina News: https://news.sina.com.cn
- NetEase News: https://news.163.com
- Tencent News: https://news.qq.com
- Sohu News: https://news.sohu.com
International News Websites:
- BBC News: https://www.bbc.com/news
- Reuters: https://www.reuters.com
- CNN: https://edition.cnn.com
Tech News:
- 36Kr: https://36kr.com
- Huxiu: https://www.huxiu.com
If the user has a custom configuration file , prioritize using the configuration in it.
~/.daily-news-config.yaml第2步:访问新闻网站
Step 2: Access News Websites
使用Playwright MCP工具访问每个新闻源:
bash
undefinedUse the Playwright MCP tool to access each news source:
bash
undefined使用browser_navigate工具导航到网站
Use browser_navigate tool to navigate to the website
mcp__playwright__browser_navigate(url="https://news.sina.com.cn")
然后获取页面快照:
```bashmcp__playwright__browser_navigate(url="https://news.sina.com.cn")
Then get a page snapshot:
```bash使用browser_snapshot获取页面可访问性快照
Use browser_snapshot to get page accessibility snapshot
mcp__playwright__browser_snapshot()
undefinedmcp__playwright__browser_snapshot()
undefined第3步:提取新闻列表
Step 3: Extract News List
从页面快照中分析并提取新闻条目。查找以下元素:
- 标题(headline/title)
- 链接(URL)
- 简短描述(description/excerpt,如果有)
- 时间信息(publish time,如果有)
提取策略:
- 识别新闻列表区域(通常是包含多个文章链接的区域)
- 提取每条新闻的标题和链接
- 最多提取20条重要新闻
- 去除重复和广告内容
示例代码模式:
python
undefinedAnalyze and extract news entries from the page snapshot. Look for the following elements:
- Headline/title
- Link (URL)
- Short description/excerpt (if available)
- Publish time (if available)
Extraction Strategy:
- Identify news list areas (usually areas containing multiple article links)
- Extract the title and link of each news item
- Extract up to 20 important news items
- Remove duplicates and ad content
Example code pattern:
python
undefined从快照中分析新闻链接
Analyze news links from snapshot
news_links = []
for item in snapshot:
if '标题' in item or 'title' in str(item).lower():
# 提取标题和链接
news_links.append({
'title': extract_title(item),
'url': extract_url(item)
})
undefinednews_links = []
for item in snapshot:
if '标题' in item or 'title' in str(item).lower():
# Extract title and link
news_links.append({
'title': extract_title(item),
'url': extract_url(item)
})
undefined第4步:访问具体新闻文章
Step 4: Access Specific News Articles
对于提取的重要新闻(前10-15条),逐个访问完整文章页面:
bash
undefinedFor the extracted important news items (top 10-15), access each full article page individually:
bash
undefined导航到文章页面
Navigate to the article page
mcp__playwright__browser_navigate(url=news_url)
mcp__playwright__browser_navigate(url=news_url)
获取文章内容快照
Get article content snapshot
mcp__playwright__browser_snapshot()
从文章页面提取:
- 完整标题
- 正文内容
- 发布时间
- 作者信息(如果有)mcp__playwright__browser_snapshot()
Extract from the article page:
- Full title
- Article content
- Publish time
- Author information (if available)第5步:生成AI摘要
Step 5: Generate AI Summary
为每篇文章生成3-5句话的详细摘要:
摘要要求:
- 准确概括文章核心内容
- 包含关键事实和细节(时间、地点、人物、事件)
- 客观中立,不添加个人观点
- 使用简洁明了的中文语言
- 总共3-5句话,每句话信息量丰富
提示词模板:
请为以下新闻文章生成一个5句话的详细摘要。
标题:{title}
文章内容:
{content}
摘要要求:
1. 准确概括文章的核心内容
2. 包含关键事实和细节
3. 客观中立,不添加个人观点
4. 使用简洁明了的语言
5. 总共5句话,每句话信息量丰富
请生成摘要:Generate a detailed 3-5 sentence summary for each article:
Summary Requirements:
- Accurately summarize the core content of the article
- Include key facts and details (time, location, people, events)
- Be objective and neutral without adding personal opinions
- Use concise and clear Chinese language
- A total of 3-5 sentences, each with rich information
Prompt Template:
Please generate a 5-sentence detailed summary for the following news article.
Title: {title}
Article Content:
{content}
Summary Requirements:
1. Accurately summarize the core content of the article
2. Include key facts and details
3. Be objective and neutral without adding personal opinions
4. Use concise and clear language
5. A total of 5 sentences, each with rich information
Please generate the summary:第6步:生成总体概述
Step 6: Generate Overall Overview
在所有文章摘要生成后,生成一个当日新闻总体概述(3-5句话):
提示词模板:
请为以下{count}条新闻生成一个总体概述(3-5句话),突出当日最重要的新闻主题和趋势:
新闻标题列表:
{titles}
请生成一个简短的总体概述:After generating all article summaries, generate an overall daily news overview (3-5 sentences):
Prompt Template:
Please generate an overall overview (3-5 sentences) for the following {count} news items, highlighting the most important news topics and trends of the day:
List of News Titles:
{titles}
Please generate a brief overall overview:第7步:生成Markdown报告
Step 7: Generate Markdown Report
将所有内容整理成格式化的Markdown文件:
markdown
undefinedOrganize all content into a formatted Markdown file:
markdown
undefined每日新闻摘要
Daily News Summary
日期: 2024年01月07日
生成时间: 08:00
新闻数量: 15条
Date: January 07, 2024
Generation Time: 08:00
Number of News Items: 15
📰 今日概述
📰 Today's Overview
今日要闻的总体概述,3-5句话总结当日最重要的新闻主题...
Overall overview of today's top news, 3-5 sentences summarizing the most important news topics of the day...
📋 详细新闻
📋 Detailed News
1. 新闻标题
1. News Title
Publish Time: 2024-01-07 10:30
Source: Sina News
Summary: First sentence summary. Second sentence summary. Third sentence summary. Fourth sentence summary. Fifth sentence summary, including key details.
2. 另一条新闻标题
2. Another News Title
统计信息
Statistical Information
- 总新闻数: 15
- 新闻源: 新浪新闻、网易新闻、BBC News
- 类别: 时政、财经、科技、国际
本摘要由AI自动生成,内容来源于各大新闻网站
undefined- Total News Items: 15
- News Sources: Sina News, NetEase News, BBC News
- Categories: Current Affairs, Finance, Technology, International
This summary is automatically generated by AI, content sourced from major news websites
undefined第8步:保存文件
Step 8: Save File
将生成的Markdown保存到文件。默认位置:
- 目录:
~/Daily-News-Summary/ - 文件名: (例如:news-summary-2024-01-07.md)
news-summary-{date}.md
使用Write工具保存:
python
Write(file_path="~/Daily-News-Summary/news-summary-2024-01-07.md", content=markdown_content)Save the generated Markdown to a file. Default location:
- Directory:
~/Daily-News-Summary/ - File name: (e.g., news-summary-2024-01-07.md)
news-summary-{date}.md
Use the Write tool to save:
python
Write(file_path="~/Daily-News-Summary/news-summary-2024-01-07.md", content=markdown_content)处理特殊场景
Handling Special Scenarios
场景1:用户询问特定主题的新闻
Scenario 1: User Asks for News on a Specific Topic
如果用户说"今天有什么科技新闻?"或"政治方面的新闻":
- 在提取新闻时进行过滤,只保留相关主题
- 或者在访问时直接导航到对应的分类页面
If the user says "What tech news is there today?" or "News about politics":
- Filter when extracting news to only retain relevant topics
- Or directly navigate to the corresponding category page when accessing
- Tech News: https://news.sina.com.cn/tech/
- Finance News: https://news.sina.com.cn/finance/
场景2:用户指定新闻网站
Scenario 2: User Specifies News Websites
如果用户说"总结BBC今天的新闻"或"只看新浪新闻":
- 只访问用户指定的新闻源
- 跳过其他默认源
If the user says "Summarize today's news from BBC" or "Only look at Sina News":
- Only access the news sources specified by the user
- Skip other default sources
场景3:快速摘要模式
Scenario 3: Quick Summary Mode
如果用户说"简单总结一下"或"快速浏览":
- 每篇文章只生成1-2句话摘要
- 减少文章数量(5-10条)
- 生成更简洁的总体概述
If the user says "Give a brief summary" or "Quick browse":
- Generate only 1-2 sentence summaries per article
- Reduce the number of articles (5-10 items)
- Generate a more concise overall overview
场景4:详细模式
Scenario 4: Detailed Mode
如果用户说"详细总结"或"完整报告":
- 每篇文章生成5-7句话摘要
- 增加文章数量(15-20条)
- 为每篇文章添加更多细节(引用、数据等)
If the user says "Detailed summary" or "Complete report":
- Generate 5-7 sentence summaries per article
- Increase the number of articles (15-20 items)
- Add more details for each article (quotes, data, etc.)
最佳实践
Best Practices
-
并行处理: 可以同时打开多个浏览器标签页访问不同新闻源,使用创建新标签
mcp__playwright__browser_tabs(action="new") -
错误处理: 如果某个网站无法访问,继续处理其他网站,并在最终报告中注明
-
去重: 不同新闻源可能报道同一事件,需要识别并合并重复新闻
-
优先级排序: 将重要新闻(时政、重大事件)放在前面
-
时间信息: 尽可能保留新闻的发布时间,并按时间倒序排列
-
资源清理: 任务完成后使用关闭浏览器
mcp__playwright__browser_close()
-
Parallel Processing: Multiple browser tabs can be opened simultaneously to access different news sources, useto create new tabs
mcp__playwright__browser_tabs(action="new") -
Error Handling: If a website is inaccessible, continue processing other websites and note it in the final report
-
Deduplication: Different news sources may report the same event, so it's necessary to identify and merge duplicate news
-
Priority Sorting: Place important news (current affairs, major events) at the top
-
Time Information: Retain the publish time of news as much as possible, and sort in reverse chronological order
-
Resource Cleanup: Close the browser usingafter the task is completed
mcp__playwright__browser_close()
调试和日志
Debugging and Logging
在执行过程中,向用户报告进度:
✓ 正在访问新浪新闻...
✓ 已提取20条新闻
✓ 正在生成摘要 (1/20)...
✓ 正在生成摘要 (2/20)...
...
✓ 生成总体概述...
✓ 摘要已保存到 ~/Daily-News-Summary/news-summary-2024-01-07.mdReport progress to the user during execution:
✓ Accessing Sina News homepage...
✓ Extracted 20 news items
✓ Generating summary (1/20)...
✓ Generating summary (2/20)...
...
✓ Generating overall overview...
✓ Summary saved to ~/Daily-News-Summary/news-summary-2024-01-07.md配置文件(可选)
Configuration File (Optional)
如果用户创建了 ,读取其配置:
~/.daily-news-config.yamlyaml
news_sources:
- name: "新浪新闻"
url: "https://news.sina.com.cn"
enabled: true
language: "zh"
- name: "BBC News"
url: "https://www.bbc.com/news"
enabled: true
language: "en"
output:
directory: "~/Daily-News-Summary"
format: "markdown"
summary:
max_articles: 20
sentences_per_article: 5使用Read工具读取配置:
python
Read(file_path="~/.daily-news-config.yaml")If the user creates , read its configuration:
~/.daily-news-config.yamlyaml
news_sources:
- name: "Sina News"
url: "https://news.sina.com.cn"
enabled: true
language: "zh"
- name: "BBC News"
url: "https://www.bbc.com/news"
enabled: true
language: "en"
output:
directory: "~/Daily-News-Summary"
format: "markdown"
summary:
max_articles: 20
sentences_per_article: 5Use the Read tool to read:
python
Read(file_path="~/.daily-news-config.yaml")完整示例对话
Complete Example Conversation
用户: 总结今天的新闻
Claude:
- 访问新浪新闻首页
- 访问网易新闻首页
- 访问BBC News首页
- 提取重要新闻列表
- 逐个访问新闻文章页面
- 生成每篇文章的详细摘要
- 生成总体概述
- 保存到 ~/Daily-News-Summary/news-summary-2024-01-07.md
✅ 已完成!共处理15条新闻,摘要已保存。
User: Summarize today's news
Claude:
- Access Sina News homepage
- Access NetEase News homepage
- Access BBC News homepage
- Extract important news list
- Access each news article page individually
- Generate detailed summary for each article
- Generate overall overview
- Save to ~/Daily-News-Summary/news-summary-2024-01-07.md
✅ Completed! A total of 15 news items processed, summary saved.