From 94ea7a8cd41b5b0cebf2606f4319ca5050e80520 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Sun, 5 Jul 2020 21:03:38 -0400 Subject: Add some new stuff --- imagebin | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 imagebin (limited to 'imagebin') diff --git a/imagebin b/imagebin new file mode 100755 index 0000000..a5de360 --- /dev/null +++ b/imagebin @@ -0,0 +1,16 @@ +#!/bin/sh + +# pastebin an image. if xsel is installed, copy the URL to the X clipboard. +# uses this API: https://ibin.co/tools.php +# no support for using a login + API key, don't need it. + +url="$( + curl -F file="@${1:-}" https://imagebin.ca/upload.php | \ + grep ^url: | \ + cut -d: -f2- +)" + +if [ -n "$url" ]; then + echo "$url" + which xsel &>/dev/null && echo -n "$url" | xsel +fi -- cgit v1.2.3