mcpField
P
pp-foxnews

pp-foxnews

github.com/mvanhorn其他2.1k86 次安装今天更新
代码仓库

关于 pp-foxnews

pp-foxnews 是使用 `foxnews-pp-cli` 读取 Fox News 官方 Google Publisher RSS 标题的技能,适合需要按栏目获取只读 JSON 新闻数据的 Agent 和脚本。

主要功能

  1. 01按栏目读取新闻标题
  2. 02列出可用 RSS 栏目
  3. 03输出结构化 Agent 上下文
  4. 04检查 RSS 连通性
  5. 05返回精简 JSON

适用场景

  1. 01获取最新新闻简报
  2. 02收集政治或体育新闻标题
  3. 03查询有效的栏目标识

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/mvanhorn/printing-press-library --skill pp-foxnews

安装后在 Claude Code 中输入/pp-foxnews确认已加载。

详细介绍

Fox News — Printing Press 命令行工具

前置条件:安装命令行工具

此技能通过 foxnews-pp-cli 二进制文件运行。调用任何命令前,请确认已安装该命令行工具。

  1. 通过 Printing Press 安装程序安装:
    npx -y @mvanhorn/printing-press-library install foxnews --cli-only
    
  2. 验证:foxnews-pp-cli --version
  3. 确保 $GOPATH/bin(或 $HOME/go/bin)位于 $PATH 中。

如果 --version 报告“command not found”,请先修复 $PATH,再运行技能命令。

何时使用此命令行工具

用于获取来自官方 Google Publisher RSS 源的只读 Fox News 标题列表。每个分区只需调用一次有界 JSON 请求——无需 API 密钥,也无需解析 HTML。

  • 默认分区 latest = 所有主题的标题混合列表
  • 使用 --section 获取 world、politics、science、health、sports、travel、tech、opinion 或 video 分区

何时不使用此命令行工具

不要用于发帖、评论、付费墙后的文章正文、电视直播节目单或非 Fox 数据源。此命令行工具只读取下方列出的 RSS 源。

不是 Drudge Report 命令行工具

这不是 drudgereport-pp-cli。此处不存在以下命令:

  • which、sync、splash、breaking、tail、tenure、sources、on-date、bent、story、digest

对于 Fox News,请使用:

  • sections —— 列出有效的 --section ID(默认源为 latest)
  • headlines —— 获取一个分区的标题
  • agent-context —— 命令、分区和默认值的运行时 JSON 目录
  • doctor —— RSS 连接检查

RSS 分区

分区CLI --sectionFeed URL
最新(默认)latesthttps://moxie.foxnews.com/google-publisher/latest.xml
世界worldhttps://moxie.foxnews.com/google-publisher/world.xml
政治politicshttps://moxie.foxnews.com/google-publisher/politics.xml
科学sciencehttps://moxie.foxnews.com/google-publisher/science.xml
健康healthhttps://moxie.foxnews.com/google-publisher/health.xml
体育sportshttps://moxie.foxnews.com/google-publisher/sports.xml
旅行travelhttps://moxie.foxnews.com/google-publisher/travel.xml
科技techhttps://moxie.foxnews.com/google-publisher/tech.xml
观点opinionhttps://moxie.foxnews.com/google-publisher/opinion.xml
视频videohttps://moxie.foxnews.com/google-publisher/videos.xml

运行 foxnews-pp-cli sections --json 获取机器可读列表。

命令

headlines

获取某个分区的标题(默认 latest)。

foxnews-pp-cli headlines --json
foxnews-pp-cli headlines --section politics --limit 10 --json --select title,link,published
foxnews-pp-cli headlines --section sports --agent
sections

列出有效的 --section 值。

foxnews-pp-cli sections --json
agent-context

为 Agent 输出结构化 JSON(包含命令、分区、default_section: latest 和明确的 not_available 列表)。

foxnews-pp-cli agent-context --pretty
doctor

探测最新源(连接冒烟测试)。

foxnews-pp-cli doctor --json

使用示例

此刻的头条(所有分区)
foxnews-pp-cli headlines --limit 15 --agent

解析 .results 获取标题行;使用 .meta.section 和 .meta.feed_url 追溯来源。

政治简报
foxnews-pp-cli headlines --section politics --limit 10 --agent --select title,link
在运行时发现分区
foxnews-pp-cli agent-context | jq '.default_section, .sections[].id'

身份验证设置

无需身份验证。

运行 foxnews-pp-cli doctor 验证 RSS 连接。

输出默认行为

与其他 Printing Press 命令行工具(例如 drudgereport、hackernews)一致:

  • 管道 stdout(Agent/bash 工具):自动输出 JSON——无需指定 --json
  • 交互式终端:默认输出纯文本表格,除非传入 --json 或 --agent

Agent 模式

为任意命令添加 --agent。它会展开为:--json --compact --no-input --no-color --yes。

  • 可通过管道传递 —— JSON 输出到 stdout,错误输出到 stderr
  • 精简 —— headlines 保留 title、link、published、section(除非 --select 覆盖,否则会移除 categories、description、guid)
  • 可筛选 —— 对于显式字段列表,--select 优先于 --compact
  • 可预览 —— --dry-run 可在不获取数据的情况下验证标志
  • 只读 —— 从不更改远程状态
响应封装

机器 JSON 会像 Drudge 基于存储的读取一样封装数据:

{
  "meta": {"source": "live", "feed_url": "...", "section": "latest", "count": 10},
  "results": [ {"title": "...", "link": "...", "published": "...", "section": "latest"} ]
}

从 .results 中解析行,并从 .meta.source / .meta.feed_url 中解析来源信息。sections 使用 "source": "catalog";doctor 会在 results 中返回状态对象。

foxnews-pp-cli headlines --section latest --limit 10 --agent

仅安装 skill

npx skills add mvanhorn/printing-press-library/cli-skills/pp-foxnews -g -y

评论

支持 Markdown