@froth/fediverse-imagebot (2.1.1)

Published 2022-12-28 15:39:55 +00:00 by sam in sam/fediverse-imagebot

Installation

@froth:registry=
npm install @froth/fediverse-imagebot@2.1.1
"@froth/fediverse-imagebot": "2.1.1"

About this package

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.

Downloading pre-built binaries

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!

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 install it permanently

    npx --package=@froth/feditoken feditoken
    

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.

Dependencies

Dependencies

ID Version
booru 2.6.3
command-line-args 5.2.1
command-line-usage 6.1.3
got 12.5.3
json5 2.2.2
megalodon 5.0.1
p-retry 5.1.2

Development Dependencies

ID Version
@types/command-line-args 5.2.0
@types/command-line-usage 5.0.2
@types/http-cache-semantics ^4.0.1
@types/node 18.11.18
@typescript-eslint/eslint-plugin 5.47.1
@typescript-eslint/parser 5.47.1
eslint 8.30.0
eslint-config-prettier 8.5.0
eslint-plugin-prettier 4.2.1
pkg 5.8.0
prettier 2.8.1
typescript 4.9.4
Details
npm
2022-12-28 15:39:55 +00:00
7
Sam Therapy
0BSD
latest
7.6 KiB
Assets (1)
Versions (1) View all
2.1.1 2022-12-28