Skip to content

Instantly share code, notes, and snippets.

Avatar

Justin Kromlinger hashworks

View GitHub Profile
@hashworks
hashworks / kutt.sh
Created Nov 6, 2020
BASH function for kutt.it URL shortener services
View kutt.sh
KUTT_HOST="https://kutt.it"
KUTT_API_KEY="API_KEY"
kutt() {
if [[ "$1" == "delete" ]] && [[ -n "$2" ]]; then
curl -s -H "X-API-KEY: $KUTT_API_KEY" \
-X DELETE \
"$KUTT_HOST/api/v2/links/$2" | jq
elif [[ -z "$1" ]]; then
curl -s -H "X-API-KEY: $KUTT_API_KEY" \
"$KUTT_HOST/api/v2/links" | jq