Last active
September 15, 2021 11:01
-
-
Save jpollack/93050bbe33a996628f72f8f2a9ab3733 to your computer and use it in GitHub Desktop.
play-wdcb.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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