Ahh, that's because you're not using the comma as separator character.
You need to put the - instead of the comma.
Also this script is very fine tuned for the original version of the 7.html, not the one you use.
For example the offending block at the beginning where your script hangs will try to find the separator character 5 times and will delete everything up to that.
This is because the original 7.html contains 5 blocks of info separated by commas that are not the artist and title fields of Icecast.
Your version starts with the artist field then <newline/space>-<newline/space> and then the title.
I think for your 7.xsl you need to remove the whole block. This one here should actually contain all the parts you need and has everything commented out that's not needed for your version of the status page:
Code:
{ PAL Script created on 4/10/2006 1:50:23 PM }
{==================================================}
WriteLn('Lets make this puppy run all the time');
PAL.Loop := True;
{ You will need to edit the next line to point to the URL you are pulling from.}
var html : String = WebToStr('http://mscp3.live-streams.nl:8330/7.xsl');
//var head : String = '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">';
WriteLn('full HTML:');
WriteLn(html);
{
Delete(html, Pos(head, html), Length(head));
WriteLn('HTML without header');
WriteLn(html);
var i : Integer = 0;
var j : Integer = 0;
PAL.LockExecution;
while j < 6 do
begin
i := i + 1;
if (CharAt(html, i) = '-') then
begin
j := j + 1;
end;
end;
PAL.UnlockExecution;
Delete(html, 1, i+1);
WriteLn('HTML before the sixth separator');
WriteLn(html);
}
var sepa : String = ' - ';
var artist : String = html;
var title : String = html;
Delete(artist, Pos(sepa, artist), Length(artist));
WriteStr('artist: ');
WriteLn(artist);
Delete(title, 1, Pos(sepa, title) + Length(sepa) - 1);
WriteStr('title: ');
WriteLn(title);
var Song : TSongInfo;
Song := TSongInfo.Create;
Song['artist'] := artist;
Song['title'] := title;
Encoders.SongChange(Song);
Song.Free;
WriteLn('Waiting 10 Seconds so we are not constantly updating.');
PAL.WaitForTime(T['+00:00:10']); //Wait 5 secs;
I'm not 100% sure as I can't make out what's supposed to be the title and what the artist. You're only streaming a dutch call-to-action, but not an artist/title of any musical track as far as I can tell. Here's the full output of my modified script:
Code:
Lets make this puppy run all the time
full HTML:
Piratenhits.FM -Live- - Groet of verzoek? kijk op onze website! Piratenhits.FM -Live- - Groet of verzoek? kijk op onze website! Radio San-Diego
artist: Piratenhits.FM -Live-
title: Groet of verzoek? kijk op onze website! Piratenhits.FM -Live- - Groet of verzoek? kijk op onze website! Radio San-Diego
Waiting 10 Seconds so we are not constantly updating.
It looks like you got the same info in both the artist and title fields, but since you're using the same separator string in your SAM encoders as you do in the XSL file, it will pick the artist part on the artist field and then use all remaining characters as the title (which in your case is title - artist - title)
If this is right, you should modify your XSL file and only print either artist or title field, but not both and most certainly don't use the <newline/space>-<newline/space> separator sequence in the XSL if you use that in SAM already.