SHOW:
|
|
- or go back to the newest paste.
1 | - | Dro.pm uploader - Version 1.0 - check http://dro.pm for new versions. |
1 | + | Dro.pm uploader - Version 1.1 - check https://dro.pm for new versions. |
2 | ||
3 | --- | |
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"; } |
5 | + | |
6 | ||
7 | function dropm { result=$(curl --silent --user-agent cli --form "f=@$1" "https://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"; } | |
8 | ||
9 | - | $ dropm my_file.zip |
9 | + | |
10 | ||
11 | - | It will give you a code and a short link as result. The short link will automatically be copied to your clipboard. |
11 | + | $ dropm my_file.zip |
12 | ||
13 | It will give you a code and a short link as result. The short link will automatically be copied to your clipboard. Example output: | |
14 | ||
15 | - | $ dropm another_file.bmp the_long_code |
15 | + | 5cae34e31c52bd5fee451cc347646a74314a9315 dro.pm/d |
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. |
17 | + | |
18 | ||
19 | $ dropm another_file.bmp 5cae34e31c52bd5fee451cc347646a74314a9315 | |
20 | ||
21 | --- | |
22 | ||
23 | - | - In short, uploading works like this: curl -sA cli -F f=@my_file.zip dro.pm/fileman.php |
23 | + | If you want to use the function without permanently installing it, or if you want to use it from a headless system (where you don't have a browser), you can easily grab the code from the website itself: |
24 | ||
25 | - | - If you don't want the automatic clipboard copying, remove the 'echo "$result ... xsel -b;' part. |
25 | + | $ curl https://dro.pm | head |
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. |
27 | + | By using "head", you will see the first few lines of dro.pm HTML source code. The second line of the HTML source code contains the Bash function (same as above) which you can copy and just paste in your terminal. If you don't have a mouse to select and copy the text, the third line shows you a way to easily cut it out using standard tools. |
28 | ||
29 | --- | |
30 | ||
31 | Submitting links or plain text is currently not supported from the command line, only file uploads. Do you want to have this feature? Please open a ticket at https://github.com/lgommans/dro.pm/issues | |
32 | ||
33 | --- | |
34 | ||
35 | Notes: | |
36 | ||
37 | - In short, uploading works like this: curl -sA cli -F f=@my_file.zip https://dro.pm/fileman.php | |
38 | ||
39 | - If you don't want the automatic clipboard copying, remove the 'echo "$result | ... | xsel -b;' part. | |
40 | ||
41 | - Upload progress can be shown by removing --silent. |