Add a `buttersafe' opener for Buttersafe web comics. - 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 9d5228d22ed20908d726da909338b0eb70130199 (DIR) parent b3d6cec7ffd6914b2b5f10b4f7cb2e4eae4b932c (HTM) Author: Leonardo Taccari <iamleot@gmail.com> Date: Sat, 24 Mar 2018 17:58:04 Add a `buttersafe' opener for Buttersafe web comics. Diffstat: openers/buttersafe | 8 ++++++++ plumb | 4 ++++ 2 files changed, 12 insertions(+), 0 deletions(-) --- diff -r b3d6cec7ffd6 -r 9d5228d22ed2 openers/buttersafe --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/openers/buttersafe Sat Mar 24 17:58:04 2018 +0100 @@ -0,0 +1,8 @@ +#!/bin/sh + +for u in "$@"; do + jpgurl=$(curl -s -L "$u" | + xmllint --html --xpath '//div[@id="comic"]/img/@src' - 2>/dev/null | + sed -e 's/^ src="//' -e 's/"$//') + plumb "${jpgurl}" +done diff -r b3d6cec7ffd6 -r 9d5228d22ed2 plumb --- a/plumb Sat Mar 24 17:44:28 2018 +0100 +++ b/plumb Sat Mar 24 17:58:04 2018 +0100 @@ -114,6 +114,10 @@ https://nothingsuspicio.us/comics/* ) open "ogimage" "$u" ;; + http://buttersafe.com/*/*/*/* | \ + http://feedproxy.google.com/*/Buttersafe/* ) + open "buttersafe" "$u" + ;; http://* | https://* ) open "web" "$u" ;;