Use string() in XPath query to avoid sed massaging. - 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 adb3e00cb1798475096611b3a9bd791e8aeb6d6d
(DIR) parent 53a440d494208fa3b4d180745ad46dd1cf98131c
(HTM) Author: Leonardo Taccari <iamleot@gmail.com>
Date: Tue, 11 Sep 2018 14:40:45
Use string() in XPath query to avoid sed massaging.
Diffstat:
openers/buttersafe | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
---
diff -r 53a440d49420 -r adb3e00cb179 openers/buttersafe
--- a/openers/buttersafe Tue Sep 11 13:39:43 2018 +0200
+++ b/openers/buttersafe Tue Sep 11 14:40:45 2018 +0200
@@ -2,7 +2,6 @@
for u in "$@"; do
jpgurl=$(curl -gs -L "$u" |
- xmllint --html --xpath '//div[@id="comic"]/img/@src' - 2>/dev/null |
- sed -e 's/^ src="//' -e 's/"$//')
+ xmllint --html --xpath 'string(//div[@id="comic"]/img/@src)' - 2>/dev/null )
plumb "${jpgurl}"
done