Guest
Public paste!

mroddball

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