Deletes old notes for a Misskey user.
Go to file
2020-10-13 13:23:38 -07:00
LICENSE Initial commit 2020-08-23 14:20:14 -07:00
missclear.py Missclear.print: pretend to be print() even harder 2020-10-13 13:23:38 -07:00
README.md README: Add Misskey.py install info 2020-08-23 14:23:43 -07:00

missclear

Python script to quickly delete old messages on a Misskey instance.

Usage

Before using, you'll need to install the 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.