cut-off status if it's longer than 500 characters

master
Benjamin Schieder 2017-04-26 12:45:18 +01:00
parent d1a8ee0ffc
commit 0afe8aefd2
1 changed files with 6 additions and 1 deletions

View File

@ -1,4 +1,9 @@
#!/bin/bash
curl -sS -X POST --header "Authorization: Bearer ${1}" "${2}/api/v1/statuses" -d "status=${3}" 2>/dev/null
status="${3}"
if [[ -n "${status:500}" ]]; then
status="${status:0:496}..."
fi
curl -sS -X POST --header "Authorization: Bearer ${1}" "${2}/api/v1/statuses" -d "status=${status}" 2>/dev/null
#https://cloud.digitalocean.com/v1/oauth/token?client_id=CLIENT_ID&client_secret=CLIENT_SECRET&grant_type=authorization_code&code=AUTHORIZATION_CODE&redirect_uri=CALLBACK_URL