Coder Social home page Coder Social logo

ni5arga / redditwikibot Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 0.0 11 KB

RedditWikiBot is a bot that facilitates the synchronization of Reddit wiki pages with a GitHub repository and vice versa. It mirrors subreddit wiki pages to your GitHub repository and can also mirror them back to the subreddit pages if they are updated or changed in the GitHub repository.

License: MIT License

Python 100.00%
moderation praw reddit reddit-api subreddit subreddits wiki reddit-wiki subreddit-wiki mirror

redditwikibot's Introduction

RedditWikiBot

RedditWikiBot is a bot that facilitates the synchronization of Reddit wiki pages with a GitHub repository and vice versa. It is a Reddit bot written in Python which mirrors subreddit wiki pages to your GitHub repository and can also mirror them back to the subreddit pages if they are updated or changed in the GitHub repository.

Table of Contents

Introduction

RedditWikiBot consists of two main scripts:

  • RedditToGithub.py: Mirrors subreddit wiki pages to a specified GitHub repository.
  • GithubToReddit.py: Mirrors GitHub repository wiki pages to a specified subreddit.

Features

  • Bidirectional synchronization of wiki pages between Reddit and GitHub.
  • Customizable configuration to skip certain pages or directories.
  • Error handling for various scenarios, such as missing files or network issues.

Requirements

  • Python 3.x
  • PRAW (Python Reddit API Wrapper)
  • PyGithub

Installation

  1. Clone the GitHub repository:

    git clone https://github.com/ni5arga/RedditWikiBot.git
  2. Install the required Python packages:

    pip install -r requirements.txt

Configuration

Create a .env file in project root directory with the following credentials.

# Reddit API credentials
REDDIT_CLIENT_ID=your_reddit_client_id
REDDIT_CLIENT_SECRET=your_reddit_client_secret
REDDIT_USER_AGENT=your_reddit_user_agent
REDDIT_USERNAME=your_reddit_username
REDDIT_PASSWORD=your_reddit_password

# GitHub credentials
GITHUB_TOKEN=your_github_token
GITHUB_REPO_OWNER=REPO_OWNER_USERNAME
GITHUB_REPO_NAME=YOUR_REPO_NAME

# Other configurations
SUBREDDIT_NAME=your_subreddit_name
MIRROR_CONFIG=TRUE/FALSE (Setting true will mirror config/ files too, recommended to keep false)

Replace your_reddit_client_id, your_reddit_client_secret, your_reddit_user_agent, your_reddit_username, your_reddit_password, your_github_token, and your_subreddit_name with your actual credentials.

Usage

RedditToGitHub.py

Run the following command to mirror subreddit wiki pages to the GitHub repository:

python RedditToGithub.py

GithubToReddit.py

Run the following command to mirror GitHub repository wiki pages to the subreddit:

python GithubToReddit.py

Contributing

Feel free to contribute to the project by opening issues or submitting pull requests. Your feedback and contributions are highly appreciated!

redditwikibot's People

Contributors

ni5arga avatar

Stargazers

 avatar  avatar  avatar  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.