Skip to content

Instantly share code, notes, and snippets.

@spro
Created April 18, 2013 21:44
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save spro/5416485 to your computer and use it in GitHub Desktop.
Save spro/5416485 to your computer and use it in GitHub Desktop.
Follow _why's SPOOL in real time.
#!/bin/sh
# Read _why's SPOOL in real time.
# Requires `lp` and a printer.
BASEURL=http://whytheluckystiff.net
if [ ! -d SPOOL ]; then
mkdir SPOOL
fi
while true; do
curl -o index $BASEURL
for LINE in $(<index); do
if [[ $LINE == SPOOL/* ]]; then
if [ ! -f $LINE ]; then
echo $LINE
curl -o $LINE "$BASEURL/$LINE"
lp -o raw $LINE
fi
fi
done
sleep 60
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment