]> git.xolatile.top Git - emil-xolatile.top.git/commitdiff
index
authorEmil Williams <emilemilemil@cock.li>
Sun, 10 Aug 2025 21:22:11 +0000 (21:22 +0000)
committerEmil Williams <emilemilemil@cock.li>
Sun, 10 Aug 2025 21:22:11 +0000 (21:22 +0000)
files/chud_upload.sh

index 6c49c5668d17ce4792954ab31937cdf2375a163c..7133bb09fe6fc4edf6b49e62153f4ba67102e0e4 100644 (file)
@@ -1,12 +1,17 @@
-# . /path/o/chud_upload.sh
+# . /path/chud_upload.sh
 # or inline in rc
-upload(){
-url="$1"
-shift
-if [ -z "$@" ] ; then curl "$url" -F"file=@/dev/stdin"; fi
-for i in "$@"; do
-if [ "$i" = "-" ]; then i="/dev/stdin" ; fi
-curl "$url" -F"file=@$i"
-done
+upload() { # provides multifile, clipboard, and stdin support
+    url="$1"
+    shift
+    if [ -z "$@" ] ; then curl "$url" -F"file=@/dev/stdin"; fi
+    for i in "$@"; do
+        if [ "$i" = "-" ]; then i="/dev/stdin" ; fi
+        x=$(curl -F"file=@$2" $1)
+        echo $x
+        echo $x | xclip -sel c -i 2&>1 /dev/null
+    done
 }
-chud(){ upload "https://up.chud.cyou" "$@" ; }
+
+chud() { upload 'https://up.chud.cyou' "$@" ; }
+0x0 () { upload 'https://0x0.st' "$@" ; }
+lainsafe () { upload 'https://lainsafe.kalli.st' "$@" ; }