From 840a373b74a8202801126af195177b9964e8377a Mon Sep 17 00:00:00 2001 From: epoch Date: Mon, 19 Oct 2020 01:36:21 +0000 Subject: added support for gopher links of type 1 and 0 --- urititle | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'urititle') diff --git a/urititle b/urititle index 6367473..7b159da 100755 --- a/urititle +++ b/urititle @@ -59,6 +59,16 @@ magnet) ftp) curl "$1" 2>&1 | tail -n1 ;; +gopher) + type="$(printf "%s\n" "$1" | uricut -p | cut -b2- | cut -b1)" + if [ "$type" = 1 -o "$type" = "" ];then + printf "title: %s\n" "$(curl -s "$1" | grep ^i | head -n1 | cut -f1 | cut -b2-)" + elif [ "$type" = 0 ];then + printf "title: %s\n" "$(curl -s "$1" | head -n1)" + else + printf "title: don't know how to get title of non-1 gopher links" + fi + ;; ssh) if [ ! "$port" ];then port=22 -- cgit v1.2.3