summaryrefslogtreecommitdiff
path: root/config/scripts/radioinfo-1113-1024
blob: 52e4b0f59a4a3559324d13ce6e41be44f17d0c78 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
# Hit Radio FFH-Playlist
# $1 = outfile

### Variabel
Name="Hit Radio FFH [www.ffh.de]"
### 

# get...
wget -q --tries=2 --timeout=5 -O /tmp/playlist.utf8 "http://www.ffh.de/webradio/hitfinder_index.php"
iconv -c -s -f UTF8 -t ISO8859-1 /tmp/playlist.utf8 -o /tmp/playlist

# Artist/Title
artist=`grep -A15 '>Datum/Zeit<*' /tmp/playlist`
artist=${artist//*$'<td>'/}; artist=${artist//$'<'\/'td>'*/}
title=`grep -A14 '>Datum/Zeit<*' /tmp/playlist`
title=${title//*$'<td>'/}; title=${title//$'<'\/'td>'*/}

# write...
if [ $1 ]; then
	echo $Name    > $1
	echo $artist >> $1
	echo $title  >> $1
else
	echo "$Name: Interpret/Titel =  $artist / $title"
fi