aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorepoch <epoch@enzo.thebackupbox.net>2021-03-16 12:47:32 -0500
committerepoch <epoch@enzo.thebackupbox.net>2021-03-16 12:47:32 -0500
commit66cc8eddb68aecb22f275c91460a295aa6423eba (patch)
tree441e62cac923b6b20e81ea8e5bb010dcaf5c9d34
parente37893cabfe8bb251a1c2978f902623ca5ace7d5 (diff)
parent275025e5a3030f87dc281db462e52db91dfbe943 (diff)
downloaduritools-66cc8eddb68aecb22f275c91460a295aa6423eba.tar.gz
uritools-66cc8eddb68aecb22f275c91460a295aa6423eba.zip
Merge branch 'master' of ssh://thebackupbox.net:65432/uritools
-rwxr-xr-xurititle12
1 files changed, 11 insertions, 1 deletions
diff --git a/urititle b/urititle
index 662201c..5034cec 100755
--- a/urititle
+++ b/urititle
@@ -36,7 +36,7 @@ http*)
title="$(curl -si "$1" | head -c 1000000 | tr -d '\n' | tr '<' '\n' | grep -iA 10 '^title' | grep -iB 10 '^\/title>' | cut '-d>' -f2 | tr '\t' ' ' | sed 's/^ *//g' | sed 's/ *$//g' | grep .)"
printf "title: %s\n" "$title" | html_entities_decode
else
- printf "%s %s\n" "${a_header}" "${content_type}"
+ printf "%s\n" "${a_header}"
fi
fi
;;
@@ -76,6 +76,16 @@ gopher)
printf "title: don't know how to get title of non-1 gopher links"
fi
;;
+urn)
+ nid="$(printf "%s\n" "$1" | cut -d: -f2)"
+ nss="$(printf "%s\n" "$1" | cut -d: -f3)"
+ nss2="$(printf "%s\n" "$1" | cut -d: -f4)"
+ if [ "$nid" = "ietf" ];then
+ if [ "$nss" = "rfc" ];then
+ cat "/var/db/rfc/rfc${nss2}.json" | jq .title
+ fi
+ fi
+ ;;
ssh)
if [ ! "$port" ];then
port=22