|
@@ -0,0 +1,22 @@
|
|
|
+% query="$(echo "$QUERY_STRING" | sed -e 's/query=//' -e 's/+/ /g')"
|
|
|
+% result="$(img-chon.sh query $query)"
|
|
|
+% count="$(echo "$result" | wc -l)"
|
|
|
+% tags="$(img-chon.sh tags | tr '\n' ' ')"
|
|
|
+% ntags="$(echo "$tags" | wc -w)"
|
|
|
+
|
|
|
+<form>
|
|
|
+ <input name="query" value="%($query%)" />
|
|
|
+ <input type="submit" />
|
|
|
+ <span>%($count%) results.</span>
|
|
|
+ <span>%($ntags%) tags available: %($tags%)</span>
|
|
|
+</form>
|
|
|
+
|
|
|
+% mkfifo /tmp/fifofifo
|
|
|
+% img-chon.sh query-thumb $query > /tmp/fifofifo &
|
|
|
+% echo "$result" | ./bin/urldecode.awk | paste - /tmp/fifofifo | awk -F'\t' '{
|
|
|
+% print "<a href=\"" $1 "\">"
|
|
|
+% print " <img src=\"data:image/jpeg;charset=utf-8;base64, " $2 "\" />"
|
|
|
+% print "</a>"
|
|
|
+% }'
|
|
|
+% rm /tmp/fifofifo
|
|
|
+
|