Go to file
io 36a416da7a fix Pleroma.reply() not tagging 2021-06-16 04:14:18 +00:00
.editorconfig don't create infinite loop threads, finally fixes #17 2019-05-04 16:44:57 +10:00
.gitignore rewrite for anyio+aiohttp 2021-06-16 01:59:57 +00:00
Dockerfile Add a Dockerfile. 2018-11-14 00:38:07 -06:00
LICENSE-EUPL relicense 2021-06-16 01:29:53 +00:00
LICENSE-MPL relicense 2021-06-16 01:29:53 +00:00
README.md update README 2021-06-16 03:50:27 +00:00
app.json oops forgot to add the app.json 2018-12-05 12:48:33 +10:00
config.defaults.json rewrite for anyio+aiohttp 2021-06-16 01:59:57 +00:00
functions.py rewrite reply.py too 2021-06-16 03:49:34 +00:00
gen.py rewrite for anyio+aiohttp 2021-06-16 01:59:57 +00:00
main.py rewrite for anyio+aiohttp 2021-06-16 01:59:57 +00:00
pleroma.py fix Pleroma.reply() not tagging 2021-06-16 04:14:18 +00:00
reply.py rewrite reply.py too 2021-06-16 03:49:34 +00:00
requirements.txt rewrite for anyio+aiohttp 2021-06-16 01:59:57 +00:00

README.md

mstdn-ebooks

Lynnear Edition

This version makes quite a few changes from the original, such as:

  • Unicode support
  • Non-Markov stuff
  • Stores toots in a sqlite database rather than a text file
    • Doesn't unnecessarily redownload all toots every time
  • Ability to ignore specific CWs
  • Fixes Pleroma post fetching
  • Fixes Pleroma post replying too

FediBooks

Before you use mstdn-ebooks to create your own ebooks bot, I recommend checking out FediBooks. Compared to mstdn-ebooks, FediBooks offers a few advantages:

  • Hosted and maintained by someone else - you don't have to worry about updating, keeping the computer on, etc
  • No installation required
  • A nice UI for managing your bot(s)
  • Easy configuration

However, there are still a few reasons you might want to use mstdn-ebooks instead:

  • Your data stays local to your machine
  • More customisation potential - you can edit mstdn-ebooks to add functionality
  • Replying more (in)frequently than FediBooks allows

Like mstdn-ebooks, FediBooks is free, both as in free of charge and free to modify, self-host, and more.

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.

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

While there is a Docker version provided, it is not guaranteed to work. I personally don't use Docker and don't know how the Dockerfile works; it was create over a year ago by someone else and hasn't been updated since. It might work for you, it might not. If you'd like to help update the Dockerfile, please get in touch with me on the Fediverse.

Compatibility

Software Downloading statuses Posting Replying
Mastodon Yes Yes Yes
Pleroma Yes Yes Yes
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.toml. 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.
learn_from_cw false If true, mstdn-ebooks will learn from CW'd posts.
ignored_cws [] If learn_from_cw is true, do not learn from posts with these CWs.
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.
limit_length false If true, the sentence length will be random between length_lower_limit and length_upper_limit
length_lower_limit 5 The lower bound in the random number range above. Only matters if limit_length is true.
length_upper_limit 50 The upper bound in the random number range above. Can be the same as length_lower_limit to disable randomness. Only matters if limit_length is true.
overlap_ratio_enabled false If true, checks the output's similarity to the original posts.
overlap_ratio 0.7 The ratio that determins if the output is too similar to original or not. With decreasing ratio, both the interestingness of the output and the likelihood of failing to create output increases. Only matters if overlap_ratio_enabled is true.

Donating

Please don't feel obligated to donate at all.

  • Ko-Fi allows you to make one-off payments in increments of AU$3. These payments are not taxed.
  • PayPal allows you to make one-off payments of any amount in a range of currencies. These payments may be taxed.

License

This is released under the EUPL 1.2 license, and based on Lynnesbian's fork which is under the MPL 2.0 license. See LICENSE-EUPL and LICENSE-MPL for details.