> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fetchhive.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Reddit 帖子

> 配置一个工作流步骤，根据 URL 读取 Reddit 帖子

# Reddit 帖子

当你有 Reddit 帖子的 URL，并希望以数据形式获取其标题、正文、投票数、评论数和子版块时，使用 **Reddit Posts**。典型用途是读取 Google 结果中出现的 Reddit 帖子。

## 配置

| 选项 | 必填 | 说明 |
| - | - | - |
| Name | 否 | 工作流画布上的步骤标签。 |
| URL | 是 | Reddit 帖子 URL，例如 `https://www.reddit.com/r/python/comments/1asdf12/how_do_i_start_learning_python/`。 此字段支持通过 **Insert Variable** 使用工作流变量。 |
| When the step fails | 否 | 控制此步骤失败时工作流应 **Terminate Workflow** 还是 **Continue**。 |

从 **Search steps...** 的 **Content & Social** 分组中添加此步骤。

Reddit 抓取有时可能需要几分钟，因此运行可能会持续一段时间，之后才会出现记录。

## 输出

点击步骤标题栏中的 **Run** 测试该步骤。运行完成后，Fetch Hive 会在 **Output** 中显示记录。

在后续步骤中使用变量选择器，可插入该次运行可用的准确输出路径。该步骤返回记录列表，因此完整结果为：

```text theme={null}
{{step_2.output}}
```

输出是一个列表，没有 `items` 或 `results` 外层。要使用第一条记录：

```text theme={null}
{{step_2.output[0]}}
```

每条记录包括：

| 字段 | 含义 |
| - | - |
| `post_id` | Reddit 帖子 ID。 |
| `url` | 帖子 URL。 |
| `title` | 帖子标题。 |
| `description` | 帖子正文。 |
| `user_posted` | 作者用户名。 |
| `num_upvotes` | 点赞数。 |
| `num_comments` | 评论数。 |
| `date_posted` | 发布时间。 |
| `tag` | 帖子标签（如有）。 |
| `community_name` | 子版块名称。 |
| `community_url` | 子版块 URL。 |
| `community_description` | 子版块简介。 |
| `community_members_num` | 子版块成员数。 |
| `photos` | 帖子附带的图片。 |
| `videos` | 帖子附带的视频。 |

## 示例

从 **Search steps...** 的 **Content & Social** 分组中添加 **Reddit 帖子**。

将 **Name** 设为类似 `Reddit 帖子` 的名称。

在 **URL** 中输入Reddit 帖子 URL，或点击 **Insert Variable** 使用先前步骤或工作流输入中的值。

点击 **Run**，在 **Output** 中查看记录。

## 说明

* 每次运行读取一篇帖子。要读取多篇，请将其放入遍历 URL 列表的循环中。
* 添加 **Reddit Comments** 可读取帖子下的讨论。
* 每次运行至少消耗 2 个任务积分。费用随返回的记录数量增加。请参阅 [任务费用](https://docs.fetchhive.com/zh/resources/task-costs.md)。

另请参阅：[Reddit 评论](https://docs.fetchhive.com/zh/workflows/steps/web-research/reddit-comments.md)、[创建和编辑](https://docs.fetchhive.com/zh/workflows/creating-and-editing.md)、[测试与迭代](https://docs.fetchhive.com/zh/workflows/testing-and-iteration.md) 和 [错误处理](https://docs.fetchhive.com/zh/workflows/error-handling.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.