From bf47ecf36dc41bae4abd7fb1629fdf7a5f7604d3 Mon Sep 17 00:00:00 2001 From: Anon Date: Tue, 11 Oct 2022 23:30:16 -0700 Subject: [PATCH] Updated documentation --- README.md | 15 +++++++++++---- docs/configuration.md | 2 ++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6a2c7f1..829cef2 100644 --- a/README.md +++ b/README.md @@ -6,12 +6,17 @@ A live example can be viewed at [GNU/Yandere](https://yandere.cc/YandereLewdBot) Currently the bot will only run on Linux. I believe it should run on most distros but I have only tested it on Arch and Raspbian. ## About -The main purpose of this bot is to download a random image from a list of pre-configured profiles (using tags) and upload it to Pleroma. Danbooru Bot is designed to be simple to understand (from a technical perspective) and easy to modify/extend. +The main purpose of this bot is to download a random image from a list of pre-configured profiles (using tags) and upload it to Pleroma. Danbooru Bot is designed to be simple to understand (from a technical perspective) and easy to modify/extend. Despite the name, several different booru sites can be supported since modules are dynamically loaded at runtime. This project is licensed under GPLv3. See [LICENSE.txt](./LICENSE.txt). The bot is still in development and can easily be crashed by writing a poorly configured `cfg.py` file. It may also crash with encoding errors for files with non-unicode filenames. +## Booru Sites Supported +1. Danbooru +2. Gelbooru (Testing) +3. Konachan (Testing) + ## Installing To setup the python3 environment (for Arch Linux) run the following commands: ``` @@ -112,12 +117,14 @@ Next, run the following commands: If you followed the steps above the cron job should run every 30 minutes at 25 and 55 minutes past the hour. Tail the log file to ensure it's working correctly. ## Advanced cron -If you want to post in sequential order from your profiles (assuming you have multiple), you can use the `-i` flag and grep from the log file to start the bot at the next index. Don't worry about an index that is out of range. The bot will wrap around the list. Remember your first profile is always at index 0. +Included with the bot is a cron.sh script. The script will automatically pass the `-i` and `-s` (index and state switches respectively) to the bot by grepping from the log file. *This script has not been tested thoroughly so use with caution* -Below is an example on how to do this with cron: +Below is an example on how to use this script: +- Open cron.sh and make any necessary changes to the default log path. - `crontab -e` -- ``25,55 * * * * [ ! -f /absolute/path/to/log.txt ] && /absolute/path/to/run.sh >> /absolute/path/to/log.txt 2>&1 || /absolute/path/to/run.sh -i "$(expr `grep "^Profile" /absolute/path/to/log.txt | cut -d ' ' -f5 | tail -n 1` + 1)" >> /absolute/path/to/log.txt 2>&1`` +- `25,55 * * * * /absolute/path/to/cron.sh >> "/absolute/path/to/log.txt" 2>&1` - Modify the paths above to suit your preferences + - Make sure the absolute log path in the crontab file is the same as the log path in cron.sh - Save and exit ## Quickly Create Configuration Files diff --git a/docs/configuration.md b/docs/configuration.md index ca70518..646ca35 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -3,6 +3,8 @@ Danbooru Bot uses regular python files to configure posts. The default configura Included in the file is a [helper function](#settings_post) to quickly configure posts. These are located at the top of the configuration file. +Posts are configured in a 2d matrix with both the x and y offset incremented after each successful post (or failed fetch, indicating a configuration error) + Below is a detailed description of each parameter in the configuration file. ## setting_server