Created
September 10, 2013 16:16
-
-
Save mcgrew/6511789 to your computer and use it in GitHub Desktop.
Auto-download script for Classical New England performance podcast
This file contains 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 | |
RSS_URL="http://streams.wgbh.org/online/clas/clas_performance.xml" | |
if [ -z $(which xml 2>/dev/null) ]; then | |
echo "xmlstarlet does not appear to be installed." | |
echo "Please make sure it is installed and in your path"; | |
exit 1; | |
fi | |
echo "Fetching rss..." | |
curl --location --progress-bar "$RSS_URL" | xml sel -t -v "//guid" - | while read i; do | |
if [ ! -f "$(basename $i)" ]; then | |
echo "Retreiving $i..." | |
curl --location --progress-bar "$i" > "$(basename $i)" || rm "$(basename $i)" | |
else | |
break; | |
fi; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment