summaryrefslogtreecommitdiff
path: root/config/scripts/radioinfo-1093-551.utf8
blob: 420685b1165aa87bfa7a9f6b864e1fcdf99c936c (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
28
29
30
#!/bin/bash
# SPUTNIK-Playlist
# $1 = outfile

### Variabel
Name="SPUTNIK [www.sputnik.de]"
### 

# get...
wget -q --tries=2 --timeout=5 -O /tmp/playlist "http://www.sputnik.de"

# Artist/Title
present=`grep -A7 'class="current_song"' /tmp/playlist | grep -c 'nicht zu ermitteln'`
if [ $present = 0 ]; then 
	artist=`grep -A7 'class="current_song"*' /tmp/playlist`
	artist=${artist/*$'"name">'/}; artist=${artist/$'<'\/'p>'*/}
	title=`grep -A8 'class="current_song"*' /tmp/playlist`
	title=${title/*$'"title">'/}; title=${title/$'<'\/'p>'*/}
fi
# 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