pleroma ebooks with some minor tweaks for limebot
  • Python 99.6%
  • Shell 0.4%
Find a file
2026-01-19 22:05:08 -07:00
generators missing import for randint 2023-07-24 12:04:32 -04:00
third_party fix old license header 2021-09-21 13:59:45 +00:00
.editorconfig don't create infinite loop threads, finally fixes #17 2019-05-04 16:44:57 +10:00
.gitignore add bsky-bridge 2025-07-31 11:08:43 -06:00
config.defaults.json mfm tag list 2025-08-10 14:15:17 -06:00
fetch_posts.py god 2025-07-31 23:55:55 -06:00
gen.py ewa 2025-10-21 01:13:01 -06:00
LICENSE-AGPL.md license compliance stuff and other changes 2021-07-26 04:52:44 +00:00
LICENSE-MPL relicense 2021-06-16 01:29:53 +00:00
poetry.lock update depends 2025-07-31 23:10:44 -06:00
pyproject.toml ewa 2025-10-21 01:13:01 -06:00
README.md Update README.md 2025-12-09 22:38:17 -07:00
reply.py remove any generated @'s in replies to prevent accidentally mentioning somebody else on the same instance 2023-03-05 21:33:59 +00:00
run.sh lol 2026-01-19 22:05:08 -07:00
schema.sql add basic migration support 2021-09-17 06:35:35 +00:00
utils.py use external pleroma.py 2023-01-11 06:23:42 +00:00

limebooks

this is a modified version of https://codeberg.org/smitten/pleroma-ebooks which is modified from https://codeberg.org/autumn/pleroma-ebooks which is modified from https://github.com/ioistired/pleroma-ebooks which is modified from https://github.com/Lynnesbian/mstdn-ebooks which is modified from https://github.com/Jess3Jane/mastodon-ebooks

autumn's changes:

  • removes any generated @'s in replies to prevent accidentally mentioning somebody else on the same instance

smitten's changes:

  • adjusts CW filtering to be word-based regexp instead of exact match

nelle's changes:

  • make summary always null (for shrimpnet) {NOTE: this means Content Warnings are not injested at all, it will train off of CW's}
  • switch to poetry
  • add bsky crossposting support
  • remove annoying stacktrace post
  • MFM posting

How to Use

  1. Create your bot account on the server.
  2. Follow the user(s) you want to base the model on.
  3. Get an access token for your bot. See mastodon-bot for details.
  4. Copy config.defaults.json to config.json and set as access_token. Make any other config tweaks you'd like.
  5. (optional) set bskky-account and bsky-password to crosspost to bluesky.
  6. run poetry install
  7. Run poetry run fetch_posts.py to collect the posts from the followed user(s).
  8. Run poetry run gen.py to generate the sentence and write it to the server.
  9. (optional) set up cron or other periodic auto-run. run poetry run reply.py in the background.

Secure Fetch

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

Compatibility

Software Downloading statuses Posting Replying
Mastodon Yes Yes Yes
Pleroma Yes Yes Yes
Misskey Yes No No
Iceshrimp.NET* Yes Yes Yes
diaspora No No No
BlueSky No Yes No
Others Maybe Maybe Maybe

*Iceshrimp.NET currently requires a patch from https://iceshrimp.dev/iceshrimp/Iceshrimp.NET/pulls/120 (https://iceshrimp.dev/limepotato/purgatory/src/branch/outbox/patches/kopper-outbox.patch)

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

limebooks 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.

Configuration

Configuring limebooks 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/user/c.json instead, you would run poetry run fetch_posts.py --cfg /home/user/c.json instead of just poetry run fetch_posts.py

Setting Default Meaning
site https://your.instance 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) limebooks will apply to non-error posts.
learn_from_cw false If true, limebooks will learn from CW'd posts.
ignored_cws [] If learn_from_cw is true, do not learn from posts with these CW words. matches case-insensitive and by word.
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, limebooks 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 word 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.
bsky-account your_handle.bsky.social your bluesky handle, if its set to default, no post will be made to bsky and everything will operate normally.
bsky-password your_APPpassword your bluesky password, if its set to default, no post will be made to bsky and everything will operate normally.
mfm-frequency 0.0 how frequent to post mfm (percentage 1 = 100%), default is 0, so it wont post mfm at all.
mfm-list [] list of mfm tags to be used by the bot when posting mfm. example: ["x2", "flip"]

Donating

Please don't feel obligated to donate at all.

License

This is released under the AGPLv3 (only) license, and based on Lynnesbian's fork which is under the MPL 2.0 license. See LICENSE-AGPL.md and LICENSE-MPL for details.

This means you must publish the source code of any ebooks bot you make with this. A link back to this repository on your bot's profile page or profile metadata will suffice. If you make changes to the code you need to link to your fork/repo instead.