Automate Post Liking on Discourse for Testing Purposes

AI-generated summary

MihirR shared a Python script to automate liking the first post in multiple topics on a Discourse forum for testing purposes. The script, available on GitHub, features concurrent account usage, configurable thread pool size, and can fetch topic IDs from the forum or a file. It requires Python 3.6+, requests, and python-dotenv libraries. The script is designed for use in controlled environments, such as test forums, and can be used for various testing scenarios, including testing forum interactions, engagement testing, load testing, and simulating active user participation. MihirR invites users to test the script and provide feedback.

Sharing a Python script that automates the process of liking the first post (topic) in multiple topics on a Discourse forum. This can be useful for testing purposes on a test forum or experimenting with multiple accounts concurrently. You can find the script and instructions for use in the following GitHub repository:

:link: Clone the repository here

Features:

  • Fetches topic IDs from the forum or from a file.
  • Uses multiple accounts concurrently to like the first post in each topic.
  • Configurable thread pool size to control the number of concurrent workers.

Disclaimer:

:warning: This script is not intended for use on real communities. It’s designed for testing purposes only and should only be used in controlled environments like test forums.

Requirements:

  • Python 3.6+
  • requests and python-dotenv libraries (installable via pip)

How to Use:

  1. Clone the repository.
  2. Set up your environment variables in a .env file.
  3. Run the script to like posts using multiple accounts.

Some potential use cases:

  • Testing Forum Interactions: Simulate user activity on a test forum to check feature functionality and performance.
  • Engagement Testing for New Features: Test new features like badges or leaderboards under load before release.
  • Simulating Active User Participation: Ensure the forum can handle high user engagement and traffic spikes.
  • Load Testing and Scalability: Evaluate platform performance under heavy user actions to identify bottlenecks.
  • Monitoring API Rate Limits: Test API rate limits and ensure the system doesn’t exceed request thresholds.
  • User Behavior Simulation: Study how engagement (e.g., likes) affects content visibility and discussion dynamics.
  • Automated Testing of Admin Features: Automate testing of admin features like managing likes and tracking activity.
  • Demo and Presentation: Simulate engagement to showcase the forum’s potential during demos or presentations.

PS: The platform or system here generally mean your VPS.

Feel free to test it out on your local or test forums and let me know your thoughts. If you have any questions or suggestions for improvements, don’t hesitate to reach out!

Happy testing! :tada:


1 Like