#!/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