missclear/README.md

57 lines
1.6 KiB
Markdown

# missclear
Python script to quickly delete old messages on a Misskey instance.
## Usage
Before using, you'll need to install the [Misskey.py](https://pypi.org/project/Misskey.py/)
pip module:
```
# pip3 install Misskey.py
```
From the built-in help:
```
usage: missclear.py [-h] [-d DAYS] [-q] [-r RETRIES] [-A | -N] instance
Deletes old Misskey posts.
positional arguments:
instance Misskey instance domain, in format domain.tld
optional arguments:
-h, --help show this help message and exit
-d DAYS, --days DAYS How many days back to start deleting from
-q, --quiet Suppress less urgent messages
-r RETRIES, --retries RETRIES
Amount of times to retry a failed delete
-A, --no-auth Disable interactive authentication
-N, --no-cache Disable reading/saving cached tokens
```
## Cached API Tokens
The cached API token is automatically stored in either `$XDG_CACHE_DIR`
or `$HOME/.cache` if the former doesn't exist. Each instance is cached
in a separate file, under `<cache-dir>/missclear/instance.tld` for a
hypothetical instance.tld.
The `--no-cache` flag will disable the cache functionality, but requires
interactive authentication every time.
## Automated runs (e.g. crontab)
As long as you're comfortable with your API token being stored wherever
your local cache folder is stored, something like the following command
should work as an automatic function:
```
/path/to/missclear.py -Aqr 5 instance.tld
```
Usage of `--retries X` in this case is recommended, since otherwise an
API issue such as rate limiting will cause the script to loop forever.