~.town / ~cel

buttons.html.sh

buttons.html.sh: buttons.html

#!/bin/sh
export TITLE="Buttons"

find_buttons(){
	find -L /home/*/public_html/images/buttons \( -iname '*.png' -o -iname '*.gif' \) \
		-exec file {} \+ 2>&- | grep '80 x 15' | cut -d: -f1 | \
		sed 's/\/home\/\([^\/]*\)\/public_html/\/~\1/
			s/\([^\/]*\)\.[^\.]*$/\0 \1/'
}

markdown <<EOF | ./template.html.sh
### Buttons found on tilde.town

$(find_buttons | awk '{ printf "![%s](%s)\n", $2, $1 }')