unshorten - Expands a short URL & displays the original URL

hakerdefo

Short URLs can be a security risk. 'unshorten' is a simple bash script that displays the original link of a short URL. It doesn't depend on any third party service.


#!/bin/sh
echo ""
echo "Expands a short url & displays the original url."
echo ""
echo "Enter a short url: "
read input_variable
if long=$(curl -s -o /dev/null --head -w "%{url_effective}\n" -L "$input_variable"); then
echo "Original url -> $long"
else
echo "Sorry! Invalid url!"
fi



Save this script some where in your path with the name 'unshorten' and give it 'Execute' permission. Next time you come across a short URL, Don't blindly click-open it in your Browser or Mail Application, Run 'unshorten' from your terminal and enter the short URL when prompted and 'unshorten' will return the original URL.
More info on 'unshorten' can be found here,
unshorten
Cheers!!!
You Can't Always Git What You Want

VastOne

^ Very nice hakerdefo!  I have been looking for something just like this letely

I appreciate you sharing it
VSIDO      VSIDO Change Blog    

    I dev VSIDO