Skip to content

Instantly share code, notes, and snippets.

@sc137
Created March 8, 2018 20:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sc137/898416420d4c947c2f2ec926929a9a46 to your computer and use it in GitHub Desktop.
Save sc137/898416420d4c947c2f2ec926929a9a46 to your computer and use it in GitHub Desktop.
Get a tiny url from their api
#!/bin/sh
read -p "Enter the url to shorten: " URL
if [ ! -z $URL ]; then
shorty=`curl http://tinyurl.com/api-create.php?url=$URL`
echo $shorty
echo $shorty | pbcopy
echo "tinyurl copied to pasteboard"
else
echo "no URL entered"
fi
echo ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment