zeptobar-of-week: every week a microcontroller die - annna - Annna the nice fri… | |
git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws6… | |
Log | |
Files | |
Refs | |
Tags | |
README | |
--- | |
commit 488d75e24202f1ce8b3ad33cc7f0e5b670265ad9 | |
parent a9591c94d12d01c919fa1c12be01b37dd1a87c38 | |
Author: Josuah Demangeon <[email protected]> | |
Date: Wed, 1 Dec 2021 16:47:53 +0100 | |
zeptobar-of-week: every week a microcontroller die | |
Signed-off-by: Annna Robert-Houdin <[email protected]> | |
Diffstat: | |
A zeptobar-of-week | 45 +++++++++++++++++++++++++++++… | |
1 file changed, 45 insertions(+), 0 deletions(-) | |
--- | |
diff --git a/zeptobar-of-week b/zeptobar-of-week | |
@@ -0,0 +1,45 @@ | |
+#!/bin/sh -e | |
+ | |
+channel=#bitreich-books | |
+ | |
+zeptobar="$(curl -s https://zeptobars.com/en/rss | sfeed | awk -F '\t' '{ | |
+ SKIP["DATA-LOGO"]++ | |
+ SKIP["^$"]++ | |
+ IMGRE = "(https:)?//[a-z.0-9.A-Z]+/[-.A-Z.a-z.0-9._]+.(jpg|png|jpeg)" | |
+ | |
+ url = $3 | |
+ buf = $4 | |
+ | |
+ n = 0 | |
+ while (match(buf, IMGRE)) { | |
+ new = substr(buf, RSTART, RLENGTH) | |
+ if (new ~ "^//") | |
+ new = "https:" new | |
+ | |
+ skip = 0 | |
+ for (x in SKIP) | |
+ skip += (new ~ x) | |
+ if (skip == 0) { | |
+ urls[n++] = new | |
+ hash[new]++ | |
+ } | |
+ | |
+ buf = substr(buf, RSTART + RLENGTH) | |
+ } | |
+ | |
+ printf "%s", url | |
+ | |
+ for (i = 0; i < n; i++) { | |
+ hd = urls[i] | |
+ sub(/\.(jpg|jpeg|png)$/, "-HD&", hd) | |
+ if (hash[hd]) | |
+ continue | |
+ | |
+ printf " - %s", urls[i] | |
+ } | |
+ printf "\n" | |
+ | |
+ delete urls | |
+}' | sort -R | sed q)" | |
+ | |
+annna-say -c "${channel}" "This week's Zeptobar: ${zeptobar}" |