Streamscript umbaun

FRESHfire

Grünschnabel
hi,

ich hab folgendes Script
Code:
proc sclastsongs { target } {
global streamip streamport streampass
putlog "shoutcast: $target requested songhistory"
if {[catch {set sock [socket $streamip $streamport] } sockerror]} {
putlog "error: $sockerror"
return 0 } else {
puts $sock "GET /admin.cgi?pass=$streampass&mode=viewxml&page=0 HTTP/1.0"
puts $sock "User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9)"
puts $sock "Host: $streamip"
puts $sock "Connection: close"
puts $sock ""
flush $sock
while {[eof $sock] != 1} {
set bl [gets $sock]
if { [string first "standalone" $bl] != -1 } {
set songs [string range $bl [string first "<TITLE>" $bl] [expr [string last "</TITLE>" $bl] + 7]]

regsub -all "<" $songs "<" songs
regsub -all ">" $songs ">" songs
regsub -all "&" $songs "+" songs
regsub -all """ $songs "\"" songs
regsub -all "'" $songs "'" songs
regsub -all "ÿ" $songs "" songs
regsub -all "<TITLE>" $songs "LIED: " songs
regsub -all "</TITLE>" $songs "" songs
regsub -all "<SONG>" $songs "" songs
regsub -all "</SONG>" $songs " ; " songs
regsub -all "<PLAYEDAT>" $songs "" songs
regsub -all "</PLAYEDAT>" $songs "" songs
regsub -all {\d} $songs "" songs

regsub -all "´" $songs "´" songs
regsub -all "?" $songs "-" songs
regsub -all "ö" $songs "ö" songs
regsub -all "ä" $songs "ä" songs
regsub -all "ü" $songs "ü" songs
regsub -all "Ö" $songs "Ö" songs
regsub -all "Ä" $songs "Ä" songs
regsub -all "Ü" $songs "Ü" songs
regsub -all "ß" $songs "ß" songs



}}
close $sock
putserv "notice $target :$songs"
}}
das finde ich sehr gut, nur das Problem ist, die Ausgabe die in $songs landet ist nicht gerade übersichtlich, da alles hintereinander ist. Kann man das Teil so umschreiben das man für jedes Lied eine Ausgabe per putserv "notice $target :$song" machen kann und somit das ganze schön übersichtlich ausliefert!
 

Neue Beiträge

Zurück