Screenshot uploader

By zenx on Jul 23, 2011

Takes screenshot, uploads it to imgur and returns a link to that image.

#!/bin/bash

cd /tmp

if [ -f "temp.png" ]; then rm temp.png ; fi

import temp.png

if [ -f "temp.png" ]; then
        curl -F "image=@temp.png" -F "key=9549c154df3f031d351e016585c8f338" http://api.imgur.com/2/upload.xml -s |grep -oE "<original>.*png" |sed 's/<original>//'
        rm temp.png
else
        echo "failed!"
fi

Comments

Sign in to comment.
GeekShedboy123   -  Jul 23, 2011

Nice.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.