Author Topic: tny - Shortens URLs & Email-Bitcoin-Dogecoin-Litecoin addresses  (Read 2696 times)

hakerdefo

  • Posts: 524
    • View Profile
    • Looking at Linux through the Windows of Life
Here is a simple bash script that shortens a long URL using tny.im. It can also shorten email, Bitcoin, Dogecoin, Litecoin addresses.

Code: [Select]
#!/bin/sh
if [ -t 0 ]; then
if [ -z "$1" ]; then
echo ""
echo "Shortens url with tny.im url shortener."
echo ""
echo "It shortens email & Bitcoin-Dogecoin-Litecoin addresses too."
echo ""
echo "Usage: tny long_url_address keyword"
echo ""
echo "Second argument 'keyword' is optional. Use it to customize the short url."
echo ""
exit 1
fi
url=$1;
else
while read -r line; do
url=$line
done
fi
printf "%s" "Short url -> " && echo `wget -q -O - http://tny.im/yourls-api.php?action=shorturl\&format=simple\&url="$url"\&keyword="$2"`


Save this script some where in your path with the name 'tny' and give it 'Execute' permission. Next time you want to shorten a long URL, simply run 'tny' from your terminal.
More info can be found here,
tny
Cheers!!!
You Can't Always Git What You Want

VastOne

  •      v-ger
  • Posts: 4129
    • View Profile
    • VSIDO Community
Re: tny - Shortens URLs & Email-Bitcoin-Dogecoin-Litecoin addresses
« Reply #1 on: June 08, 2015, 04:54:07 AM »
You are full of surprises and great gifts mate!

Thank you hakerdefo!
VSIDO      VSIDO Twitter     VSIDO FB     VSIDO Google+   

I dev VSIDO