Skip to content

Instantly share code, notes, and snippets.

@codecat
Forked from robertbasic/imgur-uploader
Created July 4, 2012 22:23
Show Gist options
  • Save codecat/3049811 to your computer and use it in GitHub Desktop.
Save codecat/3049811 to your computer and use it in GitHub Desktop.
xfce4-screenshooter to imgur
#!/bin/bash
# Ubuntu Keyboard settings shortcut:
# xfce4-screenshooter -r -o "sh /location/to/imgur-uploader.sh"
API_KEY=YOUR_API_KEY_GOES_HERE
URL=http://api.imgur.com/2/upload
RESPONSE=$(curl -s -F "key=$API_KEY" -F "image=@$1" $URL)
echo "$RESPONSE" | grep -o -E "<original>.*</original>" | grep -o -E "http://.*\.png" | xsel -i -b
notify-send -i info "Screenshot uploaded" "URL has been copied to clipboard"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment