여러 사용자로 Discourse 게시물 생성 자동화하기

Summary
This Python script automates the process of creating topics on Discourse by rotating through multiple user accounts. Once all users have posted, it loops back to the first user, making it ideal for distributed post creation on large forums. The script is useful for testing forum functionalities, such as post creation, API handling, or load testing, without requiring manual input for each post.

:hammer_and_wrench: Repository Link
GitHub Repository

:open_book: Install Guide
Clone the repository, configure your environment variables, create a topics.json file with the topics, and run the script.

Why Use This Script?

This script is designed for testing purposes, primarily to simulate the creation of multiple posts on your forum. It automates the task of posting topics from multiple user accounts, which can be helpful in scenarios like:

  • Testing API Integration: Ensure your Discourse forum API can handle multiple post requests and user interactions.
  • Load Testing: Test how your forum responds to a large volume of posts and user interactions in a short period.
  • Automation: If you need to create several posts quickly for setup or testing purposes, this script automates that process, saving time.

When to Use:

  • Testing Forum Features: If you’re developing or customizing a Discourse forum and need to ensure the post creation flow works smoothly with multiple users, this script can help test that.
  • Simulating User Interaction: Use this script to simulate posts from various users for testing purposes like moderation, content display, or user notification features.

When Not to Use:

It is not recommended to use this script for creating real content on your forum. Creating dummy posts just for the sake of filling up the forum could lead to an overcrowded and irrelevant forum. It is always advisable to encourage genuine user participation and create real posts to engage your community meaningfully. This script is purely for testing and development purposes, so avoid using it for routine content creation or as a way to artificially populate your forum.

Features:

  • Revolving User Accounts: Posts are distributed evenly across all users, ensuring fair load distribution.
  • Customizable Topics: Adjust titles, bodies, categories, images, and Markdown formatting for each topic.
  • Asynchronous Posting: Create topics quickly and efficiently with concurrent requests.

This script can be seamlessly teamed with the Discourse Users repository to automate the creation of multiple users on your Discourse forum. Once the users are created using the Discourse Users script, you can then use this posts script to automatically generate posts from each user account. This combination allows you to quickly set up both user accounts and test post creation functionality, making it ideal for testing, load simulations, and automated content generation on your forum.

2개의 좋아요

Just a note, @MihirR , the automation tag is for topics relating to Discourse Automation.

1개의 좋아요

Oh sure, my bad! Will keep in mind :slight_smile:

1개의 좋아요

@MihirR 안녕하세요. 정말 고급스러운 기능인 것 같습니다. Discourse API를 활용하여 매일 자동으로 게시물을 올리는 방법이 있는지 궁금합니다. 사람이 개입할 수 있도록 게시물을 사전에 예약해 두고, 실제로는 매일 자동으로 게시물을 게시하는 방식이 가능한지요. 이를 위해 n8n을 사용하는 방안을 고려하고 있습니다. 도움을 주시면 감사하겠습니다. 닐리