noticias-cangrejo
从 GNews 中获取并总结任何用户提供的主题的最新新闻文章,然后生成包含日期、问候语和热门链接的 Markdown 摘要。
安装 / 下载方式
TotalClaw CLI推荐
totalclaw install totalclaw:totalclaw~davidk2yoyo-noticias-cangrejocURL直接下载,无需登录
curl -fsSL https://skills.taituai.com/api/skills/totalclaw%3Atotalclaw~davidk2yoyo-noticias-cangrejo/file -o davidk2yoyo-noticias-cangrejo.md# NoticiasCangrejo Generate a Markdown news digest for any topic using the GNews API. ## When To Use Use this skill when the user asks for recent news on any topic, such as politics, science, startups, health, finance, sports, or local events, and wants a concise, linkable summary. ## Environment Requirement Set this environment variable before execution: - `GNEWS_API_KEY` ## Workflow 1. Receive a topic from the user. 2. Validate that `GNEWS_API_KEY` exists. 3. Query GNews Search API for up to 20 articles using topic + language. 4. Compute relevance based on topic-word overlap against article title and description. 5. Keep the top 15 ranked articles. 6. Print Markdown output with: - Date (`YYYY/MM/DD`) - Greeting line in Spanish - Topic line - Numbered list of article title + URL 7. Optionally save output to a file with `--output`. ## Execution Canonical OpenClaw execution is defined in `_meta.json` under `run`: ```bash python3 scripts/fetch_news.py "<topic>" ``` Optional parameters: - `--lang` (default: `en`) - `--max-articles` (default: `20`) - `--output` to write Markdown to a file ## Example Usage ```bash export GNEWS_API_KEY="your_api_key_here" python3 scripts/fetch_news.py "global markets" --lang en --max-articles 20 --output ./markets.md ``` --- ## 中文说明 # NoticiasCangrejo 使用 GNews API 为任意主题生成 Markdown 新闻摘要。 ## 何时使用 当用户请求关于任意主题的最新新闻(例如政治、科学、初创公司、健康、金融、体育或本地事件),并希望得到简洁、可链接的摘要时,使用此技能。 ## 环境要求 执行前设置以下环境变量: - `GNEWS_API_KEY` ## 工作流程 1. 从用户处接收一个主题。 2. 验证 `GNEWS_API_KEY` 是否存在。 3. 使用主题 + 语言查询 GNews Search API,最多获取 20 篇文章。 4. 基于主题词与文章标题和描述的重叠度计算相关性。 5. 保留排名前 15 的文章。 6. 打印 Markdown 输出,包含: - 日期(`YYYY/MM/DD`) - 西班牙语问候语 - 主题行 - 带编号的文章标题 + URL 列表 7. 可选地使用 `--output` 将输出保存到文件。 ## 执行 规范的 OpenClaw 执行方式在 `_meta.json` 的 `run` 下定义: ```bash python3 scripts/fetch_news.py "<topic>" ``` 可选参数: - `--lang`(默认:`en`) - `--max-articles`(默认:`20`) - `--output` 将 Markdown 写入文件 ## 使用示例 ```bash export GNEWS_API_KEY="your_api_key_here" python3 scripts/fetch_news.py "global markets" --lang en --max-articles 20 --output ./markets.md ```