Changed name in README

master
Thor 3 years ago
parent c9d2c277d1
commit c0df23f0b9
  1. 28
      README.md
  2. 25
      bot-lib-demo.py
  3. 0
      cringebot.py
  4. 0
      cringebot.service

@ -1,5 +1,5 @@
# cringefilter
`cringefilter` is a bot that tracks and auto-deletes on Mastodon/Pleroma accounts according to a set maximum age, if they are bad enough. Tracking multiple instances simultaneously is possible. Once a status is flagged for retention, the bot will not check it again.
# cringebot
`cringebot` is a bot that tracks and auto-deletes on Mastodon/Pleroma accounts according to a set maximum age, if they are bad enough. Tracking multiple instances simultaneously is possible. Once a status is flagged for retention, the bot will not check it again.
## Installation (Linux)
@ -14,40 +14,40 @@ apt install python3 bogofilter
pip3 install Mastodon.py html2text
```
#### Download cringefilter and make user account
#### Download cringebot and make user account
```
git clone https://git.thj.no/thor/cringefilter.git /usr/local/lib/cringefilter
useradd -d /usr/local/lib/cringefilter -M -s /bin/bash -U cringefilter
chown -R cringefilter.cringefilter /usr/local/lib/cringefilter
git clone https://git.thj.no/thor/cringebot.git /usr/local/lib/cringebot
useradd -d /usr/local/lib/cringebot -M -s /bin/bash -U cringebot
chown -R cringebot.cringebot /usr/local/lib/cringebot
```
#### Create configuration
```
cd /usr/local/lib/cringefilter
cd /usr/local/lib/cringebot
cp config.example.json config.json
editor config.json
```
#### Install systemd service
```
ln -s cringefilter.service /etc/systemd/system/cringefilter.service
systemctl enable cringefilter
systemctl start cringefilter
ln -s cringebot.service /etc/systemd/system/cringebot.service
systemctl enable cringebot
systemctl start cringebot
```
#### Management
```
# Initial setup / learning mode
python3 cringefilter.py -l
python3 cringebot.py -l
# Restart service
systemctl restart cringefilter
systemctl restart cringebot
# Check service status
systemctl status cringefilter
systemctl status cringebot
# Monitor log output
journalctl -t cringefilter -f
journalctl -t cringebot -f
```
## Maintainer

@ -0,0 +1,25 @@
import time
import json
from bot import Bot, BotClient
class MyBotClient(BotClient):
def on_poll_idle(self):
super().on_poll_idle()
def on_poll_wake(self):
super().on_poll_wake()
def on_poll_status(self, status):
super().on_poll_status(status)
def on_poll_exception(self, exc):
super().on_poll_exception(exc)
with open("config.json") as json_file:
config = json.load(json_file)
bot = Bot(MyBotClient, config)
bot.start()
while True:
time.sleep(1)
Loading…
Cancel
Save