diff options
author | epoch <epoch@hack.thebackupbox.net> | 2020-10-19 01:36:21 +0000 |
---|---|---|
committer | epoch <epoch@hack.thebackupbox.net> | 2020-10-19 01:36:21 +0000 |
commit | 840a373b74a8202801126af195177b9964e8377a (patch) | |
tree | 62864d3a982348a6ee940e6aab12a77df34b483d /urititle | |
parent | d88e13ca253bd1f2c3acad0dae911f7aa0669dec (diff) | |
download | uritools-840a373b74a8202801126af195177b9964e8377a.tar.gz uritools-840a373b74a8202801126af195177b9964e8377a.zip |
added support for gopher links of type 1 and 0
Diffstat (limited to 'urititle')
-rwxr-xr-x | urititle | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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 |