||8 months ago|
|.gitignore||8 months ago|
|LICENSE-2.0.txt||8 months ago|
|README.md||8 months ago|
|mxqueueproc.py||8 months ago|
|requirements.txt||8 months ago|
Matrix Queue Processor (matrix_queue_proc)
This is a quickly-thrown-together script which will:
- retrieve unread text messages in a Matrix room
- execute a script of your choice for each one
- mark (✅ reaction) or redact those messages on success (0); or
- reply with the process's exit code on failure.
- exit once all those messages are processed.
- (it is currently intended for occasional usage rather than continuous usage, but continuous usage may appear in the future.)
- archiving (youtube-dl, archivebox, etc...)
- e.g. using the 'Share' function on a mobile phone to enqueue links
python3 mxqueueproc.py <room ID> <command to run>
If you prefer messages to be redacted rather than ✅-reacted, use
MXQP_REDACT=1 python3 mxqueueproc.py <room ID> <command to run>
python3 mxqueueproc.py !some_room_id:example.com youtube-dl
Installation and set-up
- Set up a Python 3 virtual environment
python3 -m venv path/to/venv
- Activate it!
- Install requirements
pip install -r requirements.txt
- Activate this venv again whenever you wish to run mxqueueproc.
On first run, Matrix Queue Processor will guide you through a login.
You will need:
- your homeserver URL (e.g.
- your username (e.g.
- your password (e.g.
For more advanced commands
For more complicated commands, it may be worthwhile (or even required) to create e.g. a bash script
#!/bin/bash set -eu task=$1 do_something --serious-business --wow=very $1
set -eu makes undefined variables and command errors cause failure, so that the bot will report it to you.)
Don't forget to mark it as executable.