Decoding short URLs

If you’re also fed up of URL shorteners, especially when trying to analyze a bunch of links, simply put the following command line in a file, make it executable, and it shall then decode your bit.ly / tinyurl URLs: curl -I $1 -s | grep Location | cut -d ' ' -f2, for instance:

Alexandre-Passants-MacBook-Pro:code alex$ decodr http://bit.ly/26KFpk
http://www.sciencedirect.com/science?_ob=ArticleURL&_udi=B8CY1-4TVY5PW-1&_user=103680&_coverDate=04%2F30%2F2009&_rdoc=1&_fmt=full&_orig=search&_cdi=40101&_sort=d&_docanchor=&view=c&_acct=C000007922&_version=1&_urlVersion=0&_userid=103680&md5=1a59a2de268a1393b315426eb083669c#ack001

Advertisement
Tagged , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

Gravatar
WordPress.com Logo

Please log in to WordPress.com to post a comment to your blog.

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.