Uploading images to imgur from the Linux/Mac command line

I have been using this for a few years and felt it worthwhile sharing. Add the following to your .profile, .bashrc, etc:

imgur(){
  for i in "$@";do
    curl -# -F "image"=@"$i" -F "key"="b822c1d8c517c03062a48a1181ec0cd2" http://api.imgur.com/2/upload.xml|\
    grep -Eo '<[a-z_]+>http[^<]+'|sed 's/^<.\|_./\U&/g;s/_/ /;s/<\(.*\)>/\x1B[0;34m\1:\x1B[0m /'
  done
}

Then, when you load a new shell, you should be able to do something like:

(0)(18:23:23)chuck@sepang:~$ imgur gmailcounts2.jpg 
######################################################################## 100.0%
Original: http://i.imgur.com/KEguAM4.jpg
Imgur Page: http://imgur.com/KEguAM4
Delete Page: http://imgur.com/delete/JJfaLyU8HYnAVrF
Small Square: http://i.imgur.com/KEguAM4s.jpg
Large Thumbnail: http://i.imgur.com/KEguAM4l.jpg