Skip to content

Instantly share code, notes, and snippets.

@t3chguy
Last active October 19, 2020 15:12
Show Gist options
  • Save t3chguy/2acbecee86f34af2691ddbbfacc2abb6 to your computer and use it in GitHub Desktop.
Save t3chguy/2acbecee86f34af2691ddbbfacc2abb6 to your computer and use it in GitHub Desktop.
#!/bin/bash
hsurl="https://matrix.org"
access_token="this_was_totally_not_a_valid_token"
roomIds=($(curl "$hsurl/_matrix/client/r0/joined_rooms?access_token=$access_token" | tr '"' '\n' | grep !))
for roomId in ${roomIds[@]}
do
curl -XPOST "$hsurl/_matrix/client/r0/rooms/$roomId/leave?access_token=$access_token"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment