Return to Snippet

Revision: 6274
at May 14, 2008 03:02 by Juanje


Updated Code
#!/bin/sh

if [ -n "$1" ]; then
        url="$1"
else
        echo "Error: You must pass a URL"
        exit
fi

curl -s http://tinyurl.com/create.php?url=${url} | awk -F\" '/name=tinyurl/ {print $2}'

Revision: 6273
at May 14, 2008 02:11 by Juanje


Initial Code
#!/bin/sh

if [ -n "$1" ]; then
        url="$1"
else
        echo "Error: You must pass a URL"
        exit
fi

curl -s http://tinyurl.com/create.php?url=${url} | awk -F\" '/name=tinyurl/ {print $2}'

Initial URL

                                

Initial Description
Little script which call tinyurl.com via 'curl' for generate a sort url of the url you pass.

Initial Title
Get sort url from tinyurl.com

Initial Tags
curl, url

Initial Language
Bash