Skip to content

Instantly share code, notes, and snippets.

@jpollack
Last active September 15, 2021 11:01
Show Gist options
  • Save jpollack/93050bbe33a996628f72f8f2a9ab3733 to your computer and use it in GitHub Desktop.
Save jpollack/93050bbe33a996628f72f8f2a9ab3733 to your computer and use it in GitHub Desktop.
play-wdcb.sh
#!/bin/bash
# For when you want to listen to jazz with minimal CPU footprint
# Requires the packages: procps, curl, html2text, mpg321, grep
# Love the simplicity
_atexit() {
kill -TERM $mpgpid
kill -TERM $disppid
}
trap _atexit SIGTERM SIGINT
mpg321 --quiet http://wdcb-ice.streamguys1.com/wdcb128 2>/dev/null &
mpgpid=$!
( while true ; do
clear_console
curl -s https://wdcb.org/recently-played.php | html2text | grep -v SEARCH
sleep 60
done ) &
disppid=$!
wait $disppid
wait $mpgpid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment