Skip to content

FanfictionBot/reddit-ffn-bot

Repository files navigation

Join the chat at https://gitter.im/tusing/reddit-ffn-bot

FanFiction Bot for Reddit

This bot was made to allow reddit users to automatically get their responses, requests and promotions linked with the title, author and metadata of the story.

Features

Deployment and Installation

If you want to run your own bot or contribute to this project, make sure you have the following dependencies installed on your machine:

  • Python 3.4 or newer

Install bot as follows: Adapt the commands for your linux distribution We assume Ubuntu 14.04 and you are inside your desired installation directory.

    $ sudo apt-get install git python3.4 lxml libxml2-dev python3.4-dev
    $ sudo apt-get install python-pip
    $ git clone https://github.com/tusing/reddit-ffn-bot .
    $ pip install -r requirements.txt

Cloudflare Bypass needed for Fanfiction.net

You must install and run the FlareSolverr container:

docker run -d \
  --name=flaresolverr \
  -p 8191:8191 \
  -e LOG_LEVEL=info \
  --restart unless-stopped \
  ghcr.io/flaresolverr/flaresolverr:latest

Configuring the bot

On your Reddit account, create an app (Preferences > Apps > Create Another App). Enter https://github.com/tusing/reddit-ffn-bot/wiki/Usage as the about url and http://127.0.0.1:65010/authorize_callback as the redirect uri. Hit create.

The value under personal use script is your client ID; the value next to secret is your client secret. Open up config.ini and replace the [REDACTED]s with the appropriate values (including your own username and password).

Replace the subreddits value with a comma-separated list of the subreddits you'd like to run the bot on.

Starting the bot

Use the following command to start the bot

    $ python . -d

Advanced usage:

usage: . [-h] [-s SUBREDDITS] [-d] [-l] [-v VERBOSITY] [-c CONFIG]

optional arguments:
  -h, --help            show this help message and exit
  -s SUBREDDITS, --subreddits SUBREDDITS
                        define target subreddits; separate with commas
  -d, --default         add config file subreddits, can be in addition to -s
  -l, --dry             do not send comments.
  -v VERBOSITY, --verbosity VERBOSITY
                        The default log level. Using python level states.
  -c CONFIG, --config CONFIG
                        The location of your config.ini.

Contributing

We happily accept contributions. Please note, that we only accept pull requests into the bleeding-branch. You can find our issue page here: Issues You can find our pull request page here: Pull Requests