aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2021-02-14 13:14:20 -0300
committerSilvio Rhatto <rhatto@riseup.net>2021-02-14 13:14:20 -0300
commitfd636e5779ff348a7b06cbdf5c36a3849f1e4d3b (patch)
tree86279897feec10c80f194714ed0910c6712f5398
parent0f985c6acea52db5ba6cd738692bb9b7ee9e3eef (diff)
downloadscripts-fd636e5779ff348a7b06cbdf5c36a3849f1e4d3b.tar.gz
scripts-fd636e5779ff348a7b06cbdf5c36a3849f1e4d3b.tar.bz2
Feat: urlinfo script
-rwxr-xr-xurlinfo12
1 files changed, 12 insertions, 0 deletions
diff --git a/urlinfo b/urlinfo
new file mode 100755
index 0000000..7a4cd49
--- /dev/null
+++ b/urlinfo
@@ -0,0 +1,12 @@
+#!/bin/bash
+#
+# Retrieve basic URL info.
+#
+
+# Parameters
+BASENAME="`basename $0`"
+URL="$1"
+
+# Dispatch
+DESC="`torify curl --max-redirs 10 -L -s $URL | grep -i "<title>" | sed -n 's/.*<title>\(.*\)<\/title>.*/\1/ip;T;q' 2> /dev/null`"
+echo "Title: $DESC"