Advertisement
Guest User

Untitled

a guest
Sep 16th, 2013
419
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. PUUSH_API_KEY="API KLEY HERE"
  4.  
  5. function puush {
  6. echo $1
  7. if [ -z "$PUUSH_API_KEY" ]
  8. then
  9. echo "Set the variable PUUSH_API_KEY in $0 or with 'export PUUSH_API_KEY=\"apiKeyHere\""
  10. exit
  11. elif ! [ -r "$1" ]
  12. then
  13. echo "Specify a file to be uploaded"
  14. exit
  15. fi
  16.  
  17. POOP=$(curl "https://puush.me/api/up" -# -F "k=$PUUSH_API_KEY" -F "z=poop" -F "f=@$1" | sed -E 's/^.+,(.+),.+,.+$/\1\n/')
  18.  
  19. }
  20. if [ $1 == "region" ]
  21. then
  22. # notify-send "Capturing region"
  23. import temp.png
  24. else
  25. # notify-send "Capturing everything"
  26. import -window root temp.png
  27. fi
  28. notify-send "Uploading..."
  29. puush temp.png
  30. PO="Upload Complete: $POOP"
  31. notify-send "$PO"
  32. rm temp.png
  33. echo $POOP | xclip -selection c
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement