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.
Go to file
Sam Therapy 4e0e484456
README: Add example bot
Signed-off-by: Sam Therapy <sam@samtherapy.net>
2022-01-06 08:23:23 -06:00
src Change naming, make required node version obvious 2022-01-06 08:08:07 -06:00
.drone.yml Publish prototype for bot 2022-01-05 17:45:53 -06:00
.eslintrc.json Finish token generation, add flags to bot 2022-01-05 13:03:13 -06:00
.gitignore Finish token generation, add flags to bot 2022-01-05 13:03:13 -06:00
config.sample.jsonc Change naming, make required node version obvious 2022-01-06 08:08:07 -06:00
LICENSE Add basic stuffs 2022-01-03 17:02:06 -06:00
package.json Change naming, make required node version obvious 2022-01-06 08:08:07 -06:00
README.md README: Add example bot 2022-01-06 08:23:23 -06:00
tsconfig.json Finish token generation, add flags to bot 2022-01-05 13:03:13 -06:00
yarn.lock Finish token generation, add flags to bot 2022-01-05 13:03:13 -06:00

fediverse-imagebot

Build Status

A bot that posts (currently only local) images to the Fediverse.

Should be compatible with Mastodon, Misskey and Pleroma!

Quick start guide

  1. You need to have npm and nodejs installed.
  • Node 15 or greater is required.
  1. Install yarn:
    npm install --global yarn
  • This may be need to ran with sudo depending on your installation.
  1. Clone the repository:
    git clone https://git.freecumextremist.com/NotSam/fediverse-imagebot.git

  2. Install dependencies:
    yarn

  3. Build:
    yarn build

  4. Obtain a token. This can be done with an external tool or obtained by running yarn token and following the directions.

  • yarn token will generate a configuration file located at config.json
  1. 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.
  1. Run the bot:
    yarn local

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 && yarn local -m "Message"

This example will run the bot every hour on the hour with the post message Message.

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

Additional information

Additional help can be found by running yarn local -h or yarn token -h.