mroddball
By: a guest | Oct 11th, 2009 | Syntax:
Bash | Size: 0.32 KB | Hits: 258 | Expires: Never
out=upl.tmp.`date +%s`
echo "Uploading: $1"
curl -H Expect: -F fileupload="@$1" -F xml=yes -# "http://www.imageshack.us/index.php" > /tmp/$out 2>&1
if [ `cat /tmp/$out | grep image_link | wc -l` -lt 1 ]
then
echo "Error: $1"
else
cat /tmp/$out | tr -d " " | grep image_link | grep -o http[^\<]*
fi
rm /tmp/$out