Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Quick&Dirty script to create a mediawiki table containing all rooms in a matrix community.
# Run like this:
# curl "https://[matrixserver]/_matrix/client/r0/groups/[your token here] | python
import json
import sys
data = json.load(sys.stdin)
for room in data['chunk']:
topic = room['topic']
except KeyError:
room['topic'] = ""
print("| {} | {} | <nowiki> {} </nowiki> |".format(room['name'], '[['+room['canonical_alias']+"|"+room['canonical_alias']+"]]", room['topic'].replace('\n', ' ')))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment