diff options
author | John Ankarström <john@ankarstrom.se> | 2020-11-21 17:41:20 +0100 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2020-11-21 17:41:20 +0100 |
commit | 8b4e99e55b54b61a9b0c7063e9ee8482f99537b0 (patch) | |
tree | b6ad55d148ae9484a00f0692c9fa4b30fed0c7b5 | |
parent | acb8ecc09ba2185b21c31dba896b9d77b5f23af8 (diff) | |
download | web-8b4e99e55b54b61a9b0c7063e9ee8482f99537b0.tar.gz |
Add 'xii' tool (downloads and displays X-Image images)
-rwxr-xr-x | xii | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -0,0 +1,20 @@ +#!/bin/sh + +# Download and display X-Image images + +: ${VIEWER:=fbi} + +# Create temporary directory for images +dir=/tmp/$RANDOM +mkdir $dir + +grep '^X-Image: ' | +sed 's/^X-Image: //' | +while read url +do + curl "$url" > $dir/$RANDOM +done + +# Display images and delete them afterwards +$VIEWER $dir/* < /dev/tty +rm -r $dir |