Add support for userfriendly webcomic and corresponding opener. - plumb - Open certain URL patterns with an ad-hoc opener (plumber) (HTM) hg clone https://bitbucket.org/iamleot/plumb (DIR) Log (DIR) Files (DIR) Refs (DIR) README --- (DIR) changeset d219d62a7319b97d1432b1d9110fbb028095ed50 (DIR) parent b911b153a2d44fbde47833de43f399cafc74f74e (HTM) Author: Leonardo Taccari <iamleot@gmail.com> Date: Sat, 24 Mar 2018 19:43:06 Add support for userfriendly webcomic and corresponding opener. Diffstat: openers/userfriendly | 8 ++++++++ plumb | 3 +++ 2 files changed, 11 insertions(+), 0 deletions(-) --- diff -r b911b153a2d4 -r d219d62a7319 openers/userfriendly --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/openers/userfriendly Sat Mar 24 19:43:06 2018 +0100 @@ -0,0 +1,8 @@ +#!/bin/sh + +for u in "$@"; do + gifurl=$(curl -s -L "$u" | + xmllint --html --xpath '//img[@width="720"]/@src' - 2>/dev/null | + sed -e 's/^ src="//' -e 's/"$//') + plumb "${gifurl}" +done diff -r b911b153a2d4 -r d219d62a7319 plumb --- a/plumb Sat Mar 24 18:14:27 2018 +0100 +++ b/plumb Sat Mar 24 19:43:06 2018 +0100 @@ -120,6 +120,9 @@ *://feedproxy.google.com/*/Buttersafe/* ) open "buttersafe" "$u" ;; + *://ars.userfriendly.org/cartoons/* ) + open "userfriendly" "$u" + ;; http://* | https://* ) open "web" "$u" ;;