summaryrefslogtreecommitdiff
path: root/config/scripts/radioinfo-7-336
blob: 3128161e5373ffaadd6eddcede780ccb63067977 (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
27
#!/bin/bash
# sunshione live Playlist
# $1 = outfile

### Variabel
Name="sunshine live [www.sunshine-live.de]"
### 

# get...
wget -q --tries=2 --timeout=5 -O /tmp/playlist "http://www.sunshine-live.de/index.php?id=15"

# Artist/Title
artist=`grep -A19 'sunshine live - playlist' /tmp/playlist`
artist=${artist/*$'class="artist">'/}; artist=${artist/$'<'\/'td>'*/}
title=`grep -A18 'sunshine live - playlist' /tmp/playlist`
title=${title/*$'class="title">'/}; title=${title/$'<'\/'td>'*/}
# temp. no Info
artist=${artist:='---'}; titel=${title:='---'}

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