daily-news-caster

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Daily News Caster Skill

每日新闻播报技能

This skill allows the agent to fetch real-time news, organize it into a conversational podcast script, and generate an audio file reading the script out loud.
本技能可让Agent获取实时新闻,将其整理为对话式播客脚本,并生成朗读该脚本的音频文件。

Workflow Instructions

工作流程说明

When the user asks to get the latest news and make a podcast out of it, follow these steps strictly:
当用户要求获取最新新闻并将其制作成播客时,请严格遵循以下步骤:

Step 1: Ensure Skills are Installed

步骤1:确认技能已安装

If the
news-aggregator-skill
and
tts
skills are not already installed in the workspace, run the following commands to install them:
bash
npx skills add https://github.com/cclank/news-aggregator-skill --skill news-aggregator-skill -y
npx skills add https://github.com/noizai/skills --skill tts -y
如果工作区中尚未安装
news-aggregator-skill
tts
技能,请运行以下命令进行安装:
bash
npx skills add https://github.com/cclank/news-aggregator-skill --skill news-aggregator-skill -y
npx skills add https://github.com/noizai/skills --skill tts -y

Step 2: Fetch the Latest News

步骤2:获取最新新闻

Find the
fetch_news.py
script from the
news-aggregator-skill
(usually located in
.cursor/skills/news-aggregator-skill/scripts/fetch_news.py
or
skills/news-aggregator-skill/scripts/fetch_news.py
).
Run the script to fetch real-time news. You can specify a source (e.g.,
hackernews
,
github
,
all
) or keywords based on the user's request. Example command:
bash
python3 path/to/fetch_news.py --source all --limit 10 --deep
news-aggregator-skill
中找到
fetch_news.py
脚本(通常位于
.cursor/skills/news-aggregator-skill/scripts/fetch_news.py
skills/news-aggregator-skill/scripts/fetch_news.py
路径下)。
运行该脚本以获取实时新闻。你可以根据用户需求指定新闻来源(例如
hackernews
github
all
)或关键词。示例命令:
bash
python3 path/to/fetch_news.py --source all --limit 10 --deep

Step 3: Write the Podcast Script

步骤3:撰写播客脚本

Read the fetched news data and rewrite the information into a Markdown podcast script. Crucially, prioritize a dual-host (two-person) conversational format (e.g., Host A and Host B) in a dynamic Q&A style. The script should be:
  • Dual-Host Conversational yet concise: Write an engaging back-and-forth between two hosts. Host A should ask insightful, high-value questions to guide the conversation, and Host B should provide informative, concise answers. It should feel like a smart, fast-paced Q&A dialogue.
  • Avoid fluff: Do not include unnecessary fluff or overly long transitions. Keep it to the point (言简意赅) while retaining all critical information and facts.
  • Clearly Labeled Speakers: Start each line or paragraph with the speaker's name (e.g.,
    Host A:
    or
    Host B:
    ).
  • Structured: Use markdown headings and clear paragraphs.
  • Clear text for speech: Avoid complex URLs, raw markdown links, or unpronounceable characters in the spoken text.
Save this script to a local file named
podcast_script.md
.
Example
podcast_script.md
Content:
markdown
**Host A:** Welcome to today's news roundup. We have some exciting tech updates today. To start things off, there's a big update from [Company Name]. What are the core implications of their new release for everyday users?

**Host B:** The main takeaway is that... [Insert concise answer and summary of News Item 1]. This completely changes how we approach [Topic].

**Host A:** That's fascinating. But does this new approach raise any security concerns, especially given recent data breaches?

**Host B:** Exactly. Experts are pointing out that... [Insert analysis or context]. 

**Host A:** Moving on to the open-source world, what's trending on GitHub today that developers should pay attention to?

**Host B:** A standout project is... [Insert concise summary of News Item 2].

**Host A:** Great insights. That's all for today's quick update. Thanks for tuning in!
读取获取到的新闻数据,将信息重写为Markdown格式的播客脚本核心要求:优先采用双主持人(双人)对话格式(例如Host A和Host B),使用生动的问答风格。 脚本需要满足以下要求:
  • 双主持人对话且简洁: 撰写两个主持人之间有吸引力的互动内容。Host A需提出有洞察力、高价值的问题引导对话,Host B需提供信息丰富、简洁的回答。整体要呈现出睿智、快节奏的问答对话感。
  • 避免冗余内容: 不要加入无意义的废话或过长的过渡内容。在保留所有关键信息和事实的前提下做到言简意赅。
  • 清晰标注发言者: 每一行或段落开头标注发言者姓名(例如
    Host A:
    Host B:
    )。
  • 结构清晰: 使用Markdown标题和清晰的段落划分。
  • 适合朗读的文本: 朗读文本中避免出现复杂URL、原生Markdown链接或无法发音的字符。
将该脚本保存为本地文件,命名为
podcast_script.md
podcast_script.md
内容示例:
markdown
**Host A:** Welcome to today's news roundup. We have some exciting tech updates today. To start things off, there's a big update from [Company Name]. What are the core implications of their new release for everyday users?

**Host B:** The main takeaway is that... [Insert concise answer and summary of News Item 1]. This completely changes how we approach [Topic].

**Host A:** That's fascinating. But does this new approach raise any security concerns, especially given recent data breaches?

**Host B:** Exactly. Experts are pointing out that... [Insert analysis or context]. 

**Host A:** Moving on to the open-source world, what's trending on GitHub today that developers should pay attention to?

**Host B:** A standout project is... [Insert concise summary of News Item 2].

**Host A:** Great insights. That's all for today's quick update. Thanks for tuning in!

Step 4: Generate the Podcast Audio

步骤4:生成播客音频

Use the
tts
skill to convert the script into an audio file. Since it's a dual-host format, you must use the Timeline Mode of the
tts
skill.
Find the
tts.sh
script (usually located in
skills/tts/scripts/tts.sh
or
.cursor/skills/tts/scripts/tts.sh
).
1. Generate SRT: Convert the script to SRT format.
bash
bash path/to/tts.sh to-srt -i podcast_script.md -o podcast.srt
2. Create a Voice Map (
voice_map.json
)
: Map the lines in the SRT to the corresponding host. If the user provided reference audio files or URLs for the two roles, you MUST use them via the
reference_audio
field (requires
noiz
backend). Otherwise, assign default distinct voices.
json
{
  "default": { "voice_id": "voice_host_A", "target_lang": "zh" },
  "segments": {
    "1": { "reference_audio": "path/or/url_to_user_audio_for_host_A.wav" },
    "2": { "reference_audio": "path/or/url_to_user_audio_for_host_B.wav" },
    "3": { "reference_audio": "path/or/url_to_user_audio_for_host_A.wav" }
  }
}
(Adjust the segment numbers corresponding to the generated SRT lines for Host A and Host B).
3. Render Audio:
bash
undefined
使用
tts
技能将脚本转换为音频文件。由于是双主持人格式,你必须使用
tts
技能的时间线模式
找到
tts.sh
脚本(通常位于
skills/tts/scripts/tts.sh
.cursor/skills/tts/scripts/tts.sh
路径下)。
1. 生成SRT: 将脚本转换为SRT格式。
bash
bash path/to/tts.sh to-srt -i podcast_script.md -o podcast.srt
2. 创建音色映射(
voice_map.json
: 将SRT中的台词映射到对应的主持人。如果用户为两个角色提供了参考音频文件或URL,你必须通过
reference_audio
字段使用它们(需要
noiz
后端支持)。否则分配默认的不同音色。
json
{
  "default": { "voice_id": "voice_host_A", "target_lang": "zh" },
  "segments": {
    "1": { "reference_audio": "path/or/url_to_user_audio_for_host_A.wav" },
    "2": { "reference_audio": "path/or/url_to_user_audio_for_host_B.wav" },
    "3": { "reference_audio": "path/or/url_to_user_audio_for_host_A.wav" }
  }
}
请根据生成的SRT中Host A和Host B对应的台词调整片段编号。
3. 渲染音频:
bash
undefined

If using user's reference_audio, use the noiz backend

If using user's reference_audio, use the noiz backend

bash path/to/tts.sh render --srt podcast.srt --voice-map voice_map.json --backend noiz -o podcast_output.mp3
undefined
bash path/to/tts.sh render --srt podcast.srt --voice-map voice_map.json --backend noiz -o podcast_output.mp3
undefined

Step 5: Present the Result

步骤5:展示结果

Let the user know that the podcast has been successfully generated. You MUST provide both files back to the user:
  • Show or link to the
    podcast_script.md
    file so they can read the script.
  • Provide the path to the
    podcast_output.mp3
    file so they can listen to the audio.
  • Briefly summarize the headlines that were included in the podcast.
告知用户播客已成功生成。你必须向用户提供以下两个文件:
  • 展示
    podcast_script.md
    文件或提供其链接,方便用户查看脚本。
  • 提供
    podcast_output.mp3
    文件的路径,方便用户收听音频。
  • 简要总结播客中包含的新闻头条。