# 用 Zapier 配置一个 Discourse 主题作为另一个 Discourse 的活动流

**URL:** https://meta.discourse.org/t/use-zapier-to-configure-a-topic-on-one-discourse-as-an-activity-stream-for-another-discourse/167618
**Category:** Administrators
**Tags:** how-to, tasks, zapier
**Created:** [2020年十月19日 14:07 UTC](https://meta.discourse.org/t/use-zapier-to-configure-a-topic-on-one-discourse-as-an-activity-stream-for-another-discourse/167618 "2020-10-19T14:07:43Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![nathank](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nathank/32/290039_2.png) [@nathank](https://meta.discourse.org/u/nathank)
#### Post date: [2020年十月19日 14:07 UTC](https://meta.discourse.org/t/use-zapier-to-configure-a-topic-on-one-discourse-as-an-activity-stream-for-another-discourse/167618/1 "2020-10-19T14:07:43Z")

</div>

为了在一个 Discourse 实例中展示另一个实例的最新话题，我利用了一个基于 Zapier 的集成方案。该方案会抓取感兴趣类别中每个新话题的原始发帖（OP），并将其作为回复发布到任意指定的目标话题中。目标可以是同一个实例，也可以是不同的实例。

以下资源对实现这一功能极有帮助：

> [@Use the Zapier Discourse Zap Templates](https://meta.discourse.org/t/using-the-zapier-discourse-zap-templates/121603):
>
> Zapier has released 10 official Discourse zap templates. These templates make it possible to connect Discourse with an external application with minimal configuration. You can find them here: Scroll down that page to see the list of the currently available integrations. These templates are divided into two types. In the first type, Discourse is the trigger app. These templates allow you to publish Discourse posts to Slack, Mattermost, Discord, Rocket.Chat, F…

## 操作流程

1. 在源 Discourse 实例中设置 Webhook，以捕获相应类别中的新 **帖子** 。
  - 帖子比话题包含更多数据，这对后续步骤很有帮助。

2. 设置 Zap 以捕获该 Webhook。
3. 过滤掉所有帖子，仅保留“帖子编号（Post Number）”为 1 且“帖子阅读数（Post Reads）”为 0 的帖子： ![89af2ebdc4a18f7c87f64690c99b4bdc379220b1](https://global.discourse-cdn.com/meta/original/3X/8/9/89af2ebdc4a18f7c87f64690c99b4bdc379220b1.png)
  - 这确保您仅捕获新话题，而不会捕获后续的编辑（否则会导致重复发帖）。

4. 在接收方 Discourse 实例中创建一个用户，将其信任等级设置为 4（以便在话题已关闭时仍能发帖），并确保该用户有权访问目标类别。为该用户设置 API。
5. 在 Zap 中，使用该 API 将内容发布到目标话题中。
6. 自定义回复内容，包含链接等元素，例如： ![8a0d94a792984fad9f498818085c38d7081c5316](https://global.discourse-cdn.com/meta/original/3X/8/a/8a0d94a792984fad9f498818085c38d7081c5316.png)
7. 关闭该话题，以防止其他人发帖。
