RSS 轮询

:discourse2: 摘要 允许您自动从 RSS/ATOM 源导入内容到您的 Discourse 站点作为主题
:open_book: 安装指南 此插件已包含在 Discourse 核心中。无需单独安装该插件。

本文档介绍如何配置和使用 RSS 轮询插件,以自动将 RSS 源中的内容作为主题导入到您的 Discourse 社区。

:discourse2: 注意: Discourse RSS 轮询仅在 ProBusinessEnterprise 计划中可用。

配置 RSS 源

要启用插件,请转到 管理员 → 已安装的插件,找到 RSS 轮询 插件,并打开开关。

启用后,点击 设置,然后点击 添加源 按钮来配置您的第一个源。

您需要添加以下信息:

  • 源 URL:要导入的 RSS 或 Atom 源的 URL。
  • 类别过滤器 (可选):根据项目的类别元数据限制哪些源项目被导入。只有源类别与您输入的值匹配的项目才会被导入到 Discourse。例如,如果源包含标记有多个类别的项目,您可以输入特定的类别术语以仅导入这些项目。
  • 作者:一个现有的 Discourse 用户,将被列为从此源导入的所有主题的作者。
  • 类别:导入的主题将发布的 Discourse 类别。
  • 标签:一个或多个标签,将应用于此源的所有主题。

点击 保存 以添加源。

🎥 常见示例:YouTube 源

导入 YouTube 播放列表

使用 YouTube 的播放列表 RSS 源端点:

https://www.youtube.com/feeds/videos.xml?playlist_id=<PLAYLIST-ID>

其中 <PLAYLIST-ID> 是播放列表 URL 中找到的令牌。例如,给定此播放列表 URL:

https://www.youtube.com/playlist?list=PLxYzA1B2C3D4E5F6G7H8I9JkLmNoPqR

正确的源 URL 是:

https://www.youtube.com/feeds/videos.xml?playlist_id=PLxYzA1B2C3D4E5F6G7H8I9JkLmNoPqR

导入 YouTube 频道

使用频道 RSS 源格式:

https://www.youtube.com/feeds/videos.xml?channel_id=<CHANNEL-ID>

您可以在 YouTube 的频道 高级设置 中找到 channel_id

:warning: 直接使用标准频道 URL、用户名 URL 或自定义频道 URL 不会起作用。RSS 轮询插件需要显式的 channel_id 源 URL 格式。

测试源

在保存新或编辑的源之前,点击 测试源 以获取并分析源,而不导入任何内容。您将看到:

  • 将导入、已导入或将被跳过的项目数量的摘要计数。
  • 源中前几个项目的逐行细分,每个项目都有关于为何导入或跳过的纯语言解释。

这对于在影响您的社区之前验证您的配置(尤其是类别过滤器)非常有用。

最近的轮询

在任何现有源的编辑页面上,最近的轮询 区域显示最后几次轮询尝试。每次尝试显示导入、更新、跳过和失败的项目计数。您可以展开任何尝试以查看每个项目的详细信息,包括指向创建或更新的主题的链接。

当您点击 现在轮询 时,结果会实时显示,无需刷新页面。

设置

设置 选项卡链接到 RSS 轮询的相关站点设置。

名称 描述
rss polling feed request timeout 在放弃慢速源请求之前等待的时间(以秒为单位)。默认为 30 秒。
rss polling verbose logging 为每次轮询尝试启用详细的每个项目日志记录。默认关闭;对故障排除有用。
rss polling use pubdate 使用源项目的原始发布日期作为主题日期,而不是导入日期。
rss polling update tags 在更新主题时更新主题标签;禁用时,仅拉取初始标签。

控制主题可见性

防止主题被未列出

默认情况下,嵌入的主题在收到回复之前是未列出的。要防止 RSS 导入的主题被未列出:

  1. 转到 管理员 → 所有站点设置
  2. 搜索 embed unlisted
  3. 禁用此设置。

显示完整帖子内容

如果启用了 embed truncate 设置(默认),源主题将仅显示摘录。要显示完整内容:

  1. 转到 管理员 → 所有站点设置
  2. 搜索 embed truncate
  3. 禁用此设置。

如果完整帖子内容仍未正确显示,请配置 embed whitelist selector 设置以指定应导入哪些 HTML 元素。

常见问题

源未更新

  • 确认源 URL 有效且公开可访问。
  • 检查 rss polling frequency 是否设置得过高。
  • 验证自上次轮询以来源中是否有新项目。
  • 使用 测试源 按钮检查插件在源中看到的内容,而不进行完整轮询。
  • 启用 rss polling verbose logging 以获取每次轮询期间发生情况的更多详细信息。

主题创建日期错误

启用 rss polling use pubdate 设置以使用源项目的原始发布日期,而不是导入日期。

每个源 URL 仅导入一次

删除并重新添加相同的源 URL 不会重新导入之前处理过的项目。每个 RSS 项目仅导入一次。

其他资源

45 个赞
RSS polling plugin ignores items’ pubDate
Make RSS Polling Post In A Specific Topic
Can you add a LinkedIn RSS feed to a "Topic"
Replace a string in all posts
RSS plugin default show full post
Is it possible to show the full post content by default?
Plugin to scrape news from other sites
Trouble with a RSS feed
Where to set up the RSS feeds?
Help with RSS Polling Plugin - Fetching Complete Content & Publishing Translated Content
Substack integration?
Automatically delete topics in a category if no reply within set period
Request a howto auto post from a RSS feed to a chat channel by eg. using make.com?
Unlisted topics get sent on mailing list mode
What's the best way to build a pipeline to post scraped data into Discourse categories with custom tab-based themes?
Having polled topics only appear if a user wants to see them?
A new admin experience for RSS Polling
Migrated my old custom-built trail-journal/blog to Discourse
RSS Polling setting to use pubDate to set the date of imported topics
Importing RSS feed items from specific as topic items
RSS Polling setting to use pubDate to set the date of imported topics
Embed comments from Discourse in your single page app
Topic Ratings Plugin
Conditionally Automating Posts for YouTube Videos
I'm unsure of how oneboxing is setup for blog posts to Discourse
Ability to post newsletter as topic in discourse
Auto-post Youtube videos?
RSS polling doesn't work since dec 2022
Unlisted topics - what are they
Topics Unlisted and 'Maximum number of posts to embed' not respected?
A new admin experience for RSS Polling
Adding new posts as replies to a single topic
Not public RSS Feed?
Option to close on import
Bundling more popular plugins with Discourse core
Adding an RSS feed as topics in my site
Automatically post YouTube videos from a certain channel?
Automatically post YouTube videos from a certain channel?