Skip to content


展开 shorturl 的脚本

鉴于 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"

Posted in 技术快餐.


0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.