I made a link shortener. It was fun! Once you have the domain, all you need is some code to make the referrer. Here is mine, such as it is.
setenv theLink `echo $1 | tr -d '"' | tr -d "'"`
echo "" > $2
echo -n ' ' >> $2
echo "" >> $2