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
Renovate Bot 6a2d39122f
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
chore(deps): update typescript-eslint monorepo to v5.58.0
2023-04-10 18:01:39 +00:00
src Migrate to ESM 2022-12-28 15:58:18 +01:00
.drone.jsonnet fix(deps): Migrate to pnpm 8 2023-03-28 16:17:29 +02:00
.eslintignore Booru support (#1) 2022-03-15 19:13:35 +00:00
.eslintrc.json add retries 2022-10-28 18:30:00 +02:00
.gitignore ci: move to jsonnet 2022-10-27 20:28:12 +02:00
.prettierignore Booru support (#1) 2022-03-15 19:13:35 +00:00
config.sample.jsonc add retries 2022-10-28 18:30:00 +02:00
LICENSE Lint & Relicense 2022-06-11 14:11:33 +02:00
package.json chore(deps): update typescript-eslint monorepo to v5.58.0 2023-04-10 18:01:39 +00:00
pnpm-lock.yaml chore(deps): update typescript-eslint monorepo to v5.58.0 2023-04-10 18:01:39 +00:00
README.md add NPM instructions 2022-12-29 15:15:36 +01:00
renovate.json Update dependencies 2022-05-09 17:23:29 +02:00
tsconfig.json Migrate to ESM 2022-12-28 15:58:18 +01:00

fediverse-imagebot

Build Status

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

Compatible with Mastodon, Misskey and Pleroma!

MIGRATING MAJOR VERSIONS

See the wiki.

Boorus supported

The full list of boorus supported is found here.

Downloading the bot

There are currently three ways to do this, a pre-built binary that bundles in node, from npm, or building from source. Both are listed below.

From NPM

  1. Set up using the Gitea registry

    npm config set @froth:registry https://git.froth.zone/api/packages/sam/npm/
    
  2. After setting up the registry, either run it once

    npx --package=@froth/fediverse-imagebot fediverse-imagebot
    

    or install globally

    npm i -g @froth/fediverse-imagebot
    

Downloading pre-built binaries

NOTE: This is no longer supported since vercel/pkg is broken

Download prebuilt binaries from here. (currently supports x86_64 and arm64 on Linux [glibc or musl], macOS and Windows)

  1. Run the bot with the -w flag to have it generate a configuration file to the local directory.
  2. Edit it for your use case.
  3. Run the bot by launching the executable!

Running from Source

  1. You need to have npm and nodejs installed.
    • Node 16 or greater is required.
  2. Install pnpm:
    corepack enable
    Check https://pnpm.io/installation for more information.
  3. Clone the repository:
    git clone https://git.froth.zone/sam/fediverse-imagebot.git
  4. Install dependencies:
    pnpm i
  5. Build:
    pnpm run build
  6. Edit the config file:
    cp config.sample.jsonc config.jsonc
  7. Run the bot:
    pnpm bot

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

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 && pnpm 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.