Created
March 8, 2018 20:08
-
-
Save sc137/898416420d4c947c2f2ec926929a9a46 to your computer and use it in GitHub Desktop.
Get a tiny url from their api
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/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