#!/bin/zsh
if [ -z "$1" ];then
echo "Specify a file to upload!"
exit
fi
TMP=$(nocorrect curl -H Expect: \
-F fileupload=@"$1" \
-F xml=yes \
http://www.imageshack.us/index.php)
echo $TMP
URL=$(echo $TMP | perl -ne \
'print m,<image_link>(http://img\d+\.imageshack\.us/img\d+/\d+/.+)</image_link>,')
echo -n $URL | xclip -i
echo $(xclip -o)