Giter VIP home page Giter VIP logo

reddit-auto-comment-bot's Introduction

Reddit Auto Comment Bot

IDE: VS Code Style: black License: MIT

The code you see here represents a Python script that automates commenting on new posts made by a specific Reddit user. It utilizes the PRAW library, which provides a convenient wrapper for the Reddit API.

Prerequisites

Before you can execute or deploy this script, make sure you have the following prerequisites installed:

For execution:

For deployment on a Linux VPS:

  • pm2 (Process Manager for Node.js, can be installed via npm install pm2 -g)

Configuration

To configure the script, you need to provide the necessary credentials in a separate configuration file named config.py. Ensure you have the following information available:

Required Configuration Parameters

Reddit API Credentials

REDDIT_API_APP_ID - The client ID for your Reddit API application. This uniquely identifies your app to Reddit's API.

REDDIT_API_KEY - The client secret key for your Reddit API application. Used to authenticate your app.

REDDIT_USERNAME - The username of the Reddit account the bot will use to perform actions.

REDDIT_PASSWORD - The password for the Reddit account specified in REDDIT_USERNAME.

Bot Behavior

COMMENT_TEXT - The text the bot will post as a comment on new posts it finds.

MAX_POST_AGE - The maximum age (in months) of posts the bot will search and comment on. Posts older than this will be ignored.

DEBUG - When true, runs the bot immediately instead of scheduling it and exits. For development/testing.

Copy the config.py.example file and enter your configuration parameters.

Running the Script

To execute the script or deploy it on a Linux VPS:

  1. Clone the repository using the following command:

    git clone https://github.com/simwai/reddit-auto-comment-bot
    
  2. Navigate to the project directory:

    cd reddit-auto-comment-bot
    
  3. Configure the config.py file as mentioned in the previous section.

  4. (Windows) Run the script with

    deploy.bat
    
  5. (Linux VPS) Make sure the deploy.sh script is executable:

    sudo chmod +x deploy.sh
    
  6. (Linux VPS) Run the script manually

    sudo ./deploy.sh
    

    or start the script as a pm2 process with a specified name:

    pm2 start ./index.py --name reddit-auto-comment-bot --interpreter python --log-date-format="HH:mm DD-MM-YYYY"
    

Now, the Reddit auto comment bot is up and running, ready to monitor new posts and comment on them based on your configuration.

License

This project is licensed under the MIT License.

reddit-auto-comment-bot's People

Contributors

simwai avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.