Advertisement
Guest User

dro.pm uploader 1.0

a guest
Jan 4th, 2016
337
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. Dro.pm uploader - Version 1.0 - check http://dro.pm for new versions.
  2.  
  3. Put this in your .bashrc:
  4.  
  5. function dropm { result=$(curl --silent --user-agent cli --form "f=@$1" "http://dro.pm/fileman.php?secret=$2"); if [ "$result" == "1" ]; then echo Done; return; fi; echo "$result" | awk '{print $2}' | tr -d \\n | xsel -b; echo "$result"; }
  6.  
  7. Then use it like this:
  8.  
  9. $ dropm my_file.zip
  10.  
  11. It will give you a code and a short link as result. The short link will automatically be copied to your clipboard.
  12.  
  13. The code you can use to change the URL like this:
  14.  
  15. $ dropm another_file.bmp the_long_code
  16.  
  17. Unfortunately making text posts or shortening links is currently not supported from the command line. Do you want to have this feature? Tweet to @lucgommans.
  18.  
  19. ---
  20.  
  21. Notes:
  22.  
  23. - In short, uploading works like this: curl -sA cli -F f=@my_file.zip dro.pm/fileman.php
  24.  
  25. - If you don't want the automatic clipboard copying, remove the 'echo "$result ... xsel -b;' part.
  26.  
  27. - Upload progress can be turned on by removing --silent, but I find it just clutters the interface. Note that the maximum filesize is only like 40 megabytes anyway, this is not MegaUpload for all yarr movies.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement