FediStatusPosterExtras is a collection of shell scripts to extend the functionality of FediStatusPoster.
The scripts are intended to be used with cron to create long running bots that can post more than just a default/random image or message.
Live examples can be found at [GNU/Yandere](https://yandere.cc/YandereLewdBot)
# Scripts
The following scripts are included:
`boorubot.sh` This script demonstrates how to download a random image from a booru site (in this case gelbooru.com) and post it to your bot account. It will automatically set the sensative flag for the post based on the result. This script utalizes curl and jq to query and download images.
`imgbot.sh` This script demonstrates how to set custom text based on the path location of the image passed to it. It will utalize the same method to automatically post to the correct bot account based on the image path.
`pick_ordered.sh` This script will return a line from a text file, as well as log the location of the last line it read from. This is useful to post a list of images in order, and pass the result to the above two scripts. It will wrap around the text file if it reaches the end.
All of the above scripts expect [FediStatusPoster](https://git.yandere.cc/Anon/FediStatusPoster) to be in the root directory as this repo (ie. both repos should be in the same root directory). You can ofcourse modify the contents of the shell scripts to suit your preferences.
## Installing
You must have `git` and `python3` installed.
To setup the Python3 environment, run the following commands:
If everything worked correctly, you should see usage information on FediStatusPoster
Now cd into the Extra's folder:
```
cd ../FediStatusPosterExtras
```
## Posting Your First Image
The below example will highlight how to query and post a random image from [Gelbooru](https://gelbooru.com)
First, create your credentials using [CreatePleromaApp](https://git.yandere.cc/Anon/CreatePleromaApp). Edit `boorubot.sh` and update the DEFUALT_CREDENTIALS and DEFAULT_KEYFILE accordingly.
Second, create a file called `blacklist.txt`, and add a list of line-seperated tags you don't want to be retured as a result.
Then run the following command (add rating:general if you only want a safe image returned):
```
./boorubot.sh blacklist.txt 'gasai_yuno yandere' 'Message to post if image is safe' 'Message to post if image is nsfw'
```
The bot will return a single random result for images tagged with gasai_yuno and yandere, and post the image with the corrisponding safe or nsfw message specified in the arguments above.
# Useful Tips
To take full advantage of these scripts, they should be used in conjunction with cron to post at regular intervals.
You should edit `imgbot.sh` to tailor it to your specific needs.
Here are some example configuraitions I use for my bots:
```
# Post a random image from a directory:
05,25,45 * ** * find ~/Programs/python3/FediStatusPosterExtras/images -type f -print |\