This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
guides:matrix [2020/07/13 16:51] admin |
guides:matrix [2024/05/28 09:19] (current) admin |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Matrix On The Command Line ====== | ====== Matrix On The Command Line ====== | ||
+ | * See also [[Matrix Admin Tools]] | ||
===== Documentation ===== | ===== Documentation ===== | ||
* https://matrix.org/docs/api/client-server/#/ | * https://matrix.org/docs/api/client-server/#/ | ||
Line 12: | Line 13: | ||
* Click on the three dots at the edge of a room name and click ''Settings'' | * Click on the three dots at the edge of a room name and click ''Settings'' | ||
* Choose ''Advanced'' to see the ''Internal Room ID'' | * Choose ''Advanced'' to see the ''Internal Room ID'' | ||
- | * #glasgow on the server is ''!BOrDFgeDdZZbUvfjjs:glasgow.social'' | + | * #opensource on the server is ''!uVhYeryxRiaOwTlATT:glasgow.social'' |
===== Posting messages to a room ===== | ===== Posting messages to a room ===== | ||
Line 57: | Line 58: | ||
===== Listening to rooms ===== | ===== Listening to rooms ===== | ||
This is pretty straightforward. This is just how to see messages that are posted, but if you explore what is returned then you can see all sorts of things too (like joins, images, likes, invites etc). I run something like this on a terminal so I can see what's going on in all my rooms at a glance. Very cool. | This is pretty straightforward. This is just how to see messages that are posted, but if you explore what is returned then you can see all sorts of things too (like joins, images, likes, invites etc). I run something like this on a terminal so I can see what's going on in all my rooms at a glance. Very cool. | ||
+ | |||
+ | <code bash get_messages.sh> | ||
+ | #!/bin/bash | ||
+ | # Usage: | ||
+ | # ./get_messages.sh | ||
+ | msgtype=m.text | ||
+ | homeserver=glasgow.social | ||
+ | room=room_id_here | ||
+ | access_token=your_access_token_here | ||
+ | from=start_point_goes_here | ||
+ | |||
+ | curl -XGET "https://$homeserver/_matrix/client/r0/rooms/$room/messages?access_token=$access_token&from=$from" | ||
+ | </code> | ||
<code php ListenToMatrix.php> | <code php ListenToMatrix.php> |