Skip to content

Commit

Permalink
Update readme file
Browse files Browse the repository at this point in the history
  • Loading branch information
Rengyr committed Nov 7, 2024
1 parent 1d124b9 commit b182ff4
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,34 @@ Rengyr, <mail@rengyr.eu>

[![Project status](https://github.com/Rengyr/Vulpes-Porto/actions/workflows/rust.yml/badge.svg)](https://github.com/Rengyr/Vulpes-Porto/actions/workflows/rust.yml)

Mastodon bot to post remotely hosted photos daily at set times. The bot will prioritize images that weren't yet posted. In case of exhaustion of new photos the bot will post random photo from the pool.
Mastodon (works on GoToSocial as well !) bot to post remotely hosted photos daily at set times. The bot will prioritize images that weren't yet posted. In case of exhaustion of new photos the bot will post random photo from the pool.

The bot takes one mandatory argument which is the location of the configuration json file and this needs to be first argument. The bot supports two optional options:
### Running the bot

`--now` that will cause the bot to post one image on start-up and then continue based on the schedule in the configuration json file
The bot takes one mandatory argument (--config, -c) which is the location of the configuration json file. The bot supports optional options:

`--now, -n` that will cause the bot to post one image on start-up and then continue based on the schedule in the configuration json file

`--check, -c` that will check whether configuration file and token is valid and exit after

Example of starting bot:
```
Normal start:
./vulpes_porto ./config.json
./vulpes_porto --config ./config_example.json
Start with posting one image immediately:
./vulpes_porto --now ./config.json
./vulpes_porto --config ./config_example.json --now
```

Server side configuration example is in config.json. This file contains configuration for mastodon server, token of the bot, location of json with links of local or remote photos that will be described later, times when to post photos each day and location for file for tracking used and still unused photos.
### Configuration file

Server side configuration example is in config_example.toml (json and yaml format is as well supported). Fields of this configuration file are described inside of the example configuration files.

In the server side configuration file syslog style errors and error level can be set.
### Image sources file

Json file with links to images has following structure: list of records where each record has "location" which is a link to the remotely hosted photo or local photo. Each record can have optional message that will get posted with the photo, optional alternative text for the photo and optional content warning.
Json file with links to images has following structure: list of records where each record has "location" which is a link to the remotely hosted photo or local photo. Each record can have optional message that will get posted with the photo, optional alt text for the photo, and optional content warning.

Using local photos requires prefix "file:" in the "location" field in the json. Using local photos as well requires to have setup "local_path" in server side configuration file (see config.json example).
Using photos from local filesystem requires prefix "file:" in the "location" field in the json. Using local photos as well requires to have setup "local_path" in server side configuration file (see config_example.toml example).

Example of json structure:
```
Expand Down Expand Up @@ -54,5 +60,5 @@ Example of json structure:
]
```

Example of mastodon account that is using Vulpes Porto:\
[@toomanyfoxes@botsin.space](https://botsin.space/@toomanyfoxes)
Example of GoToSocial account that is using Vulpes Porto:\
[@toomanyfoxes@icy.arcticfluff.eu](https://icy.arcticfluff.eu/@toomanyfoxes)

0 comments on commit b182ff4

Please # to comment.