This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

imgur

By: freestyler7 on Aug 16th, 2013  |  syntax: Bash  |  size: 0.32 KB  |  views: 97  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #!/bin/bash
  2.  
  3. function uploadImage {
  4.   curl -s -F "image=@$1" -F "key=486690f872c678126a2c09a9e196ce1b" https://imgur.com/api/upload.xml | grep -E -o "<original_image>(.)*</original_image>" | grep -E -o "http://i.imgur.com/[^<]*"
  5. }
  6.  
  7. scrot -s "shot.png"
  8. uploadImage "shot.png" | xclip -selection c
  9. rm "shot.png"
  10. notify-send "Done"
clone this paste RAW Paste Data