Introduction
Introduction Statistics Contact Development Disclaimer Help
Add xkcd-uri script. - annna - Annna the nice friendly bot.
git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws6…
Log
Files
Refs
Tags
README
---
commit ea727b63c2df5e1f2a50c7d4106c96332a1e30e7
parent 3a7931d0296f037df5eeaa81a311c376445ee0d7
Author: Annna Robert-Houdin <[email protected]>
Date: Wed, 1 Sep 2021 12:04:57 +0200
Add xkcd-uri script.
Diffstat:
A xkcd-uri | 15 +++++++++++++++
1 file changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/xkcd-uri b/xkcd-uri
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+if [ $# -lt 1 ];
+then
+ printf "usage: %s xkcduri\n" "$(basename "$0")" >&2
+ exit 1;
+fi
+
+xkcduri="$(hurl "${1}" \
+ | xml2tsv 2>/dev/null \
+ | grep div/img \
+ | grep comics \
+ | cut -f 2 \
+ | sed 's,src=\(.*\),https:\1,')"
+printf "%s\n" "${xkcduri}"
You are viewing proxied material from bitreich.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.