Skip to content

Instantly share code, notes, and snippets.

@zeisss
Last active December 26, 2015 11:19
Show Gist options
  • Select an option

  • Save zeisss/7142809 to your computer and use it in GitHub Desktop.

Select an option

Save zeisss/7142809 to your computer and use it in GitHub Desktop.
Updates somafm m3u playlists files in the current folder
#!/bin/sh
# Create the interested streams by touching:
# $ touch somafm_groovesalad.m3u
# $ touch somafm_covers.m3u
for x in somafm_*.m3u
do
PLAYLIST_FILE=$x
STREAM=$(echo $PLAYLIST_FILE | sed -e 's/^somafm_//' -e 's/\.m3u$//')
echo Checking $STREAM
PLS=`curl -B http://somafm.com/${STREAM}.pls`
echo "$PLS" | \
grep -E '^File' | \
sed -e 's/^File[0-9]*=//' \
> $PLAYLIST_FILE
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment