Last active
March 13, 2024 11:02
-
-
Save lovromazgon/73d32784702198eb6140416452c93e50 to your computer and use it in GitHub Desktop.
Mute Twist thread
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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