Update docs

This commit is contained in:
smitten 2023-07-20 00:24:18 -04:00
parent c03c025773
commit d08f1f94ec
2 changed files with 10 additions and 7 deletions

View file

@ -1,16 +1,15 @@
# pleroma-ebooks
this is a very slightly modified version of <https://github.com/ioistired/pleroma-ebooks>
current changes: removes any generated @'s in replies to prevent accidentally mentioning somebody else on the same instance
this is a very slightly modified version of <https://codeberg.org/autumn/pleroma-ebooks> which is modified from <https://github.com/ioistired/pleroma-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
It's like [@AgathaSorceress's mstdn-ebooks] but it supports Pleroma better.
[@AgathaSorceress's mstdn-ebooks]: https://github.com/AgathaSorceress/mstdn-ebooks
## Secure Fetch
Secure fetch (aka authorised fetches, authenticated fetches, secure mode...) is *not* supported by pleroma-ebooks, and will fail to download any posts from users on instances with secure fetch enabled. For more information, see [this wiki page](https://github.com/Lynnesbian/mstdn-ebooks/wiki/Secure-fetch).
## How to Use
1. Create your bot account on the server.
2. Follow the user(s) you want to base the model on.
@ -18,6 +17,10 @@ Secure fetch (aka authorised fetches, authenticated fetches, secure mode...) is
4. Copy `config.defaults.json` to `config.json` and set as `access_token`. Make any other config tweaks you'd like.
5. Run `fetch_posts.py` to collect the posts from the followed user(s).
6. Run `gen.py` to generate the sentence and write it to the server.
7. (optional) set up cron or other periodic auto-run. run `reply.py` in the background.
## Secure Fetch
Secure fetch (aka authorised fetches, authenticated fetches, secure mode...) is *not* supported by pleroma-ebooks, and will fail to download any posts from users on instances with secure fetch enabled. For more information, see [this wiki page](https://github.com/Lynnesbian/mstdn-ebooks/wiki/Secure-fetch).
## Compatibility
| Software | Downloading statuses | Posting | Replying |

View file

@ -11,8 +11,8 @@ def make_sentence(cfg):
db = sqlite3.connect(cfg["db_path"])
db.text_factory = str
def cw_regexp(x):
p = regex.compile(r"\L<words>", words=cfg["ignored_cws"],flags=regex.IGNORECASE)
def cw_regexp(x):
return 1 if p.search(x) else 0
db.create_function('cwregexp', 1, cw_regexp)
c = db.cursor()