Updated documentation

This commit is contained in:
Anon 2022-10-11 23:30:16 -07:00
parent 76185a2ba4
commit bf47ecf36d
2 changed files with 13 additions and 4 deletions

View File

@ -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

View File

@ -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