A bot that posts images to the Fediverse https://blog.froth.zone/sam/the-end-of-an-era
This repository has been archived on 2023-05-27. You can view files and clone it, but cannot push or open issues or pull requests.
Find a file
Sam Therapy 67a86124b0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
Do some rudamentary README improvement
Signed-off-by: Sam Therapy <sam@samtherapy.net>
2022-03-14 10:18:47 +01:00
.yarn Do many things 2022-03-14 08:48:49 +01:00
src Add prettier exception for raw config 2022-03-14 08:52:46 +01:00
.drone.yml Do many things 2022-03-14 08:48:49 +01:00
.eslintignore Do many things 2022-03-14 08:48:49 +01:00
.eslintrc.json Do many things 2022-03-14 08:48:49 +01:00
.gitignore Do many things 2022-03-14 08:48:49 +01:00
.prettierignore Do many things 2022-03-14 08:48:49 +01:00
.yarnrc.yml Do many things 2022-03-14 08:48:49 +01:00
config.sample.jsonc Do many things 2022-03-14 08:48:49 +01:00
LICENSE Split token generation and the bot itself 2022-02-16 09:57:37 -06:00
package.json Do many things 2022-03-14 08:48:49 +01:00
README.md Do some rudamentary README improvement 2022-03-14 10:18:47 +01:00
tsconfig.json Do many things 2022-03-14 08:48:49 +01:00
yarn.lock Do many things 2022-03-14 08:48:49 +01:00

fediverse-imagebot

Build Status

A bot that posts local and booru images to the Fediverse.

Compatible with Mastodon, Misskey and Pleroma!

Boorus supported

The full list of boorus supported is found here.

Downloading pre-built binaries

Download prebuilt binaries from here (currently only supports x64), or build from source, instructions below.

Running from Source

  1. You need to have npm and nodejs installed.
  • Node 15 or greater is required.
  1. Install yarn:
    corepack enable
    Check https://yarnpkg.com/getting-started/install for more information.
  • This may be need to ran with sudo depending on your installation.
  1. Clone the repository:
    git clone https://git.froth.zone/Sam/fediverse-imagebot.git

  2. Install dependencies:
    yarn

  3. Build:
    yarn build

  4. Edit the config file:
    cp config.sample.jsonc config.jsonc

  5. Run the bot:
    yarn bot

You're done! The bot should post a local image to the fediverse instance of your choosing!

Running the bot

  1. Obtain a token. I have another tool that does this for you, which can be found here and put it in config.jsonc, following the sample jsonc file.

  2. Put images in the images folder.

  • By default the bot will look for SFW images at images/sfw and NSFW images at images/nsfw. This can be configured with the directory config setting.

Automating the bot

TODO: Elaborate more

The bot can be automated to post images at set times using a cronjob.
Example cron configuration:

0 * * * * cd /path/to/fediverse-imagebot && /usr/local/bin/yarn bot -c ./config.sample.jsonc

This example will run the bot every hour on the hour with no message using images from the default images directory.

An example of this pleroma configuration can be found at https://froth.zone/rinbot.