# 使用 Zapier 自动发送 Discourse 主题到 Facebook Fanpage

**URL:** <https://meta.discourse.org/t/automate-sending-discourse-topic-to-facebook-fanpage-with-zapier/166611>\
**Category:** Community Building\
**Created:** [2020年十月8日 03:29 UTC](https://meta.discourse.org/t/automate-sending-discourse-topic-to-facebook-fanpage-with-zapier/166611 "2020-10-08T03:29:55Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)\
**Post date:** [2020年十月8日 22:31 UTC](https://meta.discourse.org/t/automate-sending-discourse-topic-to-facebook-fanpage-with-zapier/166611/4 "2020-10-08T22:31:18Z")

</div>

> [@Bcat](#):
>
> 在使用 USER API 时，是否有其他方法可以输出包含 `excerpt = true` 的文章？

使用官方 Zapier Discourse 集成时，主题摘要不会被拉取到 Zapier 中。此外，如果您通过将 Discourse 网络钩子（webhook）添加到网络钩子触发器来连接 Zapier，Discourse 也不会发送摘要（关于如何设置的详情，请参阅：[https://meta.discourse.org/t/discourse-webhooks-and-zapier/56753）。不过，您可以在](https://meta.discourse.org/t/discourse-webhooks-and-zapier/56753%EF%BC%89%E3%80%82%E4%B8%8D%E8%BF%87%EF%BC%8C%E6%82%A8%E5%8F%AF%E4%BB%A5%E5%9C%A8) Zapier 中根据帖子的原始内容创建摘要。以下是我使用“Discourse 新帖子”触发器进行设置的步骤：

首先设置“Discourse 新帖子”触发器。相关设置详情请参阅：[https://meta.discourse.org/t/using-the-zapier-discourse-zap-templates/121603。配置完成后，触发器步骤应类似于下图：](https://meta.discourse.org/t/using-the-zapier-discourse-zap-templates/121603%E3%80%82%E9%85%8D%E7%BD%AE%E5%AE%8C%E6%88%90%E5%90%8E%EF%BC%8C%E8%A7%A6%E5%8F%91%E5%99%A8%E6%AD%A5%E9%AA%A4%E5%BA%94%E7%B1%BB%E4%BC%BC%E4%BA%8E%E4%B8%8B%E5%9B%BE%EF%BC%9A)

 ![image](https://global.discourse-cdn.com/meta/original/3X/4/6/461137b132aae976ca0edb06ccbffdb1f1b6d10f.png)

然后添加一个“Zapier 格式化器”（Formatter by Zapier）步骤。选择“文本”（Text）事件。在“转换”（Transform）选项中，选择“截断”（Truncate）。将触发器步骤中的“原始内容”（Raw content）选为输入，并将“最大长度”（Max Length）值设置为您希望在帖子中显示的字符数。配置完成后，文本步骤应类似于下图：

 ![image](https://global.discourse-cdn.com/meta/original/3X/6/2/62bef174668a8fec4656ff4194d812aaf5c08903.png)

在最后的“在 Facebook 页面创建帖子”（Create Page Post in Facebook Pages）操作步骤中，选择从文本步骤返回的“原始值”（Raw value）：

 ![image](https://global.discourse-cdn.com/meta/original/3X/5/1/511c228fc63dadd909f7ee791e101a18082ea1ca.png)

请注意，如果您使用官方 Discourse 集成或 Discourse 网络钩子（而非 RSS 订阅源），主题的永久链接（permalink）将不会自动为您设置。您可以从初始触发器步骤传递的主题别名（slug）和主题 ID 中，在操作步骤的“链接 URL”（Link URL）输入框中构建永久链接：

 ![image](https://global.discourse-cdn.com/meta/original/3X/a/8/a8a6ccc597f83ce4c1fa84dc1b19c4fc32358937.png)

关于如何创建永久链接以及添加过滤步骤的详情，请参阅此主题：[https://meta.discourse.org/t/using-the-zapier-discourse-zap-templates/121603。该指南中未包含如何截断原始帖子内容的说明。这是一条有用的信息，因此我将在该指南中补充这部分内容。](https://meta.discourse.org/t/using-the-zapier-discourse-zap-templates/121603%E3%80%82%E8%AF%A5%E6%8C%87%E5%8D%97%E4%B8%AD%E6%9C%AA%E5%8C%85%E5%90%AB%E5%A6%82%E4%BD%95%E6%88%AA%E6%96%AD%E5%8E%9F%E5%A7%8B%E5%B8%96%E5%AD%90%E5%86%85%E5%AE%B9%E7%9A%84%E8%AF%B4%E6%98%8E%E3%80%82%E8%BF%99%E6%98%AF%E4%B8%80%E6%9D%A1%E6%9C%89%E7%94%A8%E7%9A%84%E4%BF%A1%E6%81%AF%EF%BC%8C%E5%9B%A0%E6%AD%A4%E6%88%91%E5%B0%86%E5%9C%A8%E8%AF%A5%E6%8C%87%E5%8D%97%E4%B8%AD%E8%A1%A5%E5%85%85%E8%BF%99%E9%83%A8%E5%88%86%E5%86%85%E5%AE%B9%E3%80%82)

我在此概述的方法同样适用于通过 Zapier 网络钩子触发器将 Discourse 网络钩子连接到 Zapier 的情况。

---

_[View the full topic](https://meta.discourse.org/t/automate-sending-discourse-topic-to-facebook-fanpage-with-zapier/166611)._
