Add an `<meta property="og:image">' opener and use it for some webcomic sites. - 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 b3d6cec7ffd6914b2b5f10b4f7cb2e4eae4b932c
 (DIR) parent cf88c0d480a57141879dc0e048c97713aa5eb818
 (HTM) Author: Leonardo Taccari <iamleot@gmail.com>
       Date:   Sat, 24 Mar 2018 17:44:28 
       
       Add an `<meta property="og:image">' opener and use it for some webcomic sites.
       
       Diffstat:
        openers/ogimage |  8 ++++++++
        plumb           |  4 ++++
        2 files changed, 12 insertions(+), 0 deletions(-)
       ---
       diff -r cf88c0d480a5 -r b3d6cec7ffd6 openers/ogimage
       --- /dev/null   Thu Jan 01 00:00:00 1970 +0000
       +++ b/openers/ogimage   Sat Mar 24 17:44:28 2018 +0100
       @@ -0,0 +1,8 @@
       +#!/bin/sh
       +
       +for u in "$@"; do
       +       imgurl=$(curl -s -L "$u" |
       +           xmllint --html --xpath '//meta[@property="og:image"]/@content' - 2>/dev/null |
       +           sed -e 's/^ content="//' -e 's/"$//' -e 's/\?.*$//' )
       +       plumb "${imgurl}"
       +done
       diff -r cf88c0d480a5 -r b3d6cec7ffd6 plumb
       --- a/plumb     Sat Mar 24 17:18:34 2018 +0100
       +++ b/plumb     Sat Mar 24 17:44:28 2018 +0100
       @@ -110,6 +110,10 @@
                       *://*/meta/report.html )
                               open "txtweb" "$u"
                               ;;
       +               http://oppressive-silence.com/comic/* | \
       +               https://nothingsuspicio.us/comics/* )
       +                       open "ogimage" "$u"
       +                       ;;
                       http://* | https://* )
                               open "web" "$u"
                               ;;