Skip to content

Instantly share code, notes, and snippets.

@lovromazgon
Last active March 13, 2024 11:02
Show Gist options
  • Save lovromazgon/73d32784702198eb6140416452c93e50 to your computer and use it in GitHub Desktop.
Save lovromazgon/73d32784702198eb6140416452c93e50 to your computer and use it in GitHub Desktop.
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