DI.fm/SKY.fm playlist generator for MPD :-)
authorHarvie <tomas@mudrunka.cz>
Sun, 15 Jan 2012 15:37:52 +0000 (16:37 +0100)
committerHarvie <tomas@mudrunka.cz>
Sun, 15 Jan 2012 15:37:52 +0000 (16:37 +0100)
bash/di.fm.sh [new file with mode: 0755]

diff --git a/bash/di.fm.sh b/bash/di.fm.sh
new file mode 100755 (executable)
index 0000000..8046934
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/sh
+#Copylefted by Harvie 2o12
+#Generates M3U playlist for di.fm and sky.fm
+#Tip: I am running this from cron at OpenWRT router with soundcard and MPD
+
+get_playlist() {
+        echo "#Playlist generated from $1 @ $(date)"
+        wget "$1" -O - | grep -o 'http://[^"]*' | while read line; do
+                echo $(wget "$line" -O - | grep -o 'http://.*$' | grep '[a-zA-Z0-9]$' | head -n 1)?${line##*/}
+        done
+}
+
+get_playlist http://listen.di.fm/public3 > /root/playlists/di.fm.m3u
+get_playlist http://listen.sky.fm/public3 > /root/playlists/sky.fm.m3u
This page took 0.101667 seconds and 4 git commands to generate.