#!/bin/sh -

# tinyurl - command line interface to a URL shortening service
# Steve Kinzler, steve@kinzler.com, May 21/Dec 23
# https://kinzler.com/me/home.html#web

# 2023-06-15 apparently no longer available
#url=`urlencode ${1+"$@"}`
#curl -s "http://tinyurl.com/create.php?url=$url" |
#	perl -ne 'print, exit if s/^.*data-clipboard-text="([^"]*).*$/$1/i'

# 2023-12-13 only works with TinyURL, now broken
## shorten(1) distributed as an example in the libwww-shorten-perl Ubuntu pkg
#exec shorten ${1+"$@"}

# 2023-12-17 there seems to be a small limit with buku's service per ___?
# 2025-01-14 tny.im, used by buku, is shutdown
exec buku --nostdin --shorten ${1+"$@"}
