Skip to content

Instantly share code, notes, and snippets.

@mcgrew
Created September 10, 2013 16:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcgrew/6511789 to your computer and use it in GitHub Desktop.
Save mcgrew/6511789 to your computer and use it in GitHub Desktop.
Auto-download script for Classical New England performance podcast
#!/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