Grumbulon's super special fork of the now unmaintained mstdn-ebooks
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
grumbulon 1a9d3ac6ee Updated app.json 2 years ago
.editorconfig don't create infinite loop threads, finally fixes #17 4 years ago
.gitignore minor code cleanup 3 years ago
Dockerfile Fixed docker file and tested 2 years ago
LICENSE initial commit 5 years ago
README.md Updating tasks in readme 2 years ago
app.json Updated app.json 2 years ago
config.json.example Update 'config.json.example' 2 years ago
filter.txt Removed 'default slurs' from filter.txt 2 years ago
functions.py Added runtime error when program cannot generate post from markov chain 2 years ago
gen.py Minor changes 2 years ago
main.py Fixed broken fstring 2 years ago
reply.py fix silly mistake 4 years ago
requirements.txt Added sqlite to requirements 2 years ago

README.md

fedi-ebooks

Grumbulon's super special fork of the now unmaintained Lynnear Edition

Features

Secure Fetch

Secure fetch (aka authorised fetches, authenticated fetches, secure mode...) is not supported by mstdn-ebooks, and will fail to download any posts from users on instances with secure fetch enabled. For more information, see this wiki page.

Word Filtering

If you have a word or list of words you'd like your bot to never use you can now scrub the posts db of those words

  1. fill out words you want to filter in the filter.txt file
  2. run python3 main.py --scrub filter.txt
  3. let the magic happen
  4. your db is now scrubed of any post with filtered words detected

Docker image

  • You do have to make one slight edit to the Dockerfile to run
    • <editor> Dockerfile then on the line that says ENV ebooks_site= please replace freecumextremist.com with the domain your bot runs from.
  • sudo docker build -t fedibooks" . <-- this will build a valid docker image for you to go ahead and run with
  • sudo docker run fedibooks <-- this will run your ebooks bot

Install/usage Guide

An installation and usage guide is available here. It's primarily targeted at Linux, but it should be possible on BSD, macOS, etc. I've also put some effort into providing steps for Windows, but I can't make any guarantees as to its effectiveness.

Docker

In this new fork the docker file has been refined a bit and confirmed to both build and run. If there are any issues reach out to @grumbulon@freecumextremist.com

Compatibility

Software Downloading statuses Posting Replying
Mastodon Yes Yes Yes
Pleroma Yes Yes No
Misskey Yes No No
diaspora* No No No
Others Maybe No No

Note: Bots are only supported on Mastodon and Pleroma instances. Bots can learn from users on other instances, but the bot itself must run on either a Mastodon or Pleroma instance.

mstdn-ebooks uses ActivityPub to download posts. This means that it is not dependant on any particular server software, and should work with anything that (properly) implements ActivityPub. Any software that does not support ActivityPub (e.g. diaspora*) is not supported, and won't work.

I recommend that you create your bot's account on a Mastodon instance. Creating a bot on a Pleroma instance means that your bot will be unable to reply, although posting will work just fine. However, even if your bot is on a Mastodon instance, it will be able to learn from any Pleroma or Misskey users just fine.

Configuration

Configuring mstdn-ebooks is accomplished by editing config.json. If you want to use a different file for configuration, specify it with the --cfg argument. For example, if you want to use /home/lynne/c.json instead, you would run python3 main.py --cfg /home/lynne/c.json instead of just python3 main.py

Setting Default Meaning
site https://botsin.space The instance your bot will log in to and post from. This must start with https:// or http:// (preferably the latter)
cw null The content warning (aka subject) mstdn-ebooks will apply to non-error posts.
instance_blacklist ["bofa.lol", "witches.town", "knzk.me"] If your bot is following someone from a blacklisted instance, it will skip over them and not download their posts. This is useful for ensuring that mstdn-ebooks doesn't waste time trying to download posts from dead instances, without you having to unfollow the user(s) from them.
learn_from_cw false If true, mstdn-ebooks will learn from CW'd posts.
mention_handling 1 0: Never use mentions. 1: Only generate fake mentions in the middle of posts, never at the start. 2: Use mentions as normal (old behaviour).
max_thread_length 15 The maximum number of bot posts in a thread before it stops replying. A thread can be 10 or 10000 posts long, but the bot will stop after it has posted max_thread_length times.
strip_paired_punctuation false If true, mstdn-ebooks will remove punctuation that commonly appears in pairs, like " and (). This avoids the issue of posts that open a bracket (or quote) without closing it.

Todo

  • rewrite set up instructions because that page no longer exists
  • rewrites of code to move away from "toot" terminology since this is now a fedi bot no longer constrained by the verbage of mastodon users

Done

  • refinement of docker image as there are some known issues