Skip to content

Instantly share code, notes, and snippets.

@lovromazgon
Last active Nov 17, 2020
Embed
What would you like to do?
Mute Twist thread
#!/bin/bash
# Mutes a Twist thread for some time (30 minutes by default).
#
# Usage:
# ./mute_twist.sh <email> <password> <thread ID> [<minutes>]
EMAIL=$1
PASSWORD=$2
THREAD_ID=$3
MINUTES=${4:-30}
RESPONSE=$(curl -X POST https://api.twist.com/api/v3/users/login \
-d email=$EMAIL \
-d password=$PASSWORD)
TOKEN=$(echo $RESPONSE | jq -r .token)
curl -X POST https://api.twist.com/api/v3/threads/mute \
-H "Authorization: Bearer $TOKEN" \
-d id=$THREAD_ID \
-d minutes=$MINUTES
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment