展开 shorturl 的脚本

作者:yinwm
版权声明:可以任意转载,转载时请务必以超链接形式标明文章原始出处和作者信息及本版权声明。

鉴于 bitly 从我们的正常视野消失,我刚刚写了一个脚本,从http://untr.im 扩展原始的URL, 内容如下:

#!/bin/bash

URL=$1

if [ -z "$URL" ]
then
    echo "Usage : fullurl "
    exit
fi

TS=`date +"%s"`

FILE=/tmp/fullurl-$TS

wget -q -O "$FILE" --post-data "url=$1" http://untr.im/api/ajax/api

awk -F 'href="' '{print $3}' "$FILE" | awk -F '" rel="' '{print $1}'

rm "$FILE"
Oct 13th, 2009 | Posted in 技术快餐
Tags:
No comments yet.

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Powered by WP Hashcash