summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xxii20
1 files changed, 20 insertions, 0 deletions
diff --git a/xii b/xii
new file mode 100755
index 0000000..dc4a620
--- /dev/null
+++ b/xii
@@ -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