hi,
hier ist es… nur kurz getestet, aber scheint zu laufen.
[code]{-------------------------------------------------------------------------------
LogItemsToFile.mls - Notification Script for mAirList
Writes some information about broadcasted items to a file.
Author: Torben Weibert torben@weibert.de
Date: 2007-01-07
edited by Michael Schäl public@michael-schael.de
Date: 2008-02-04
See http://www.mAirList.com for further information.
-------------------------------------------------------------------------------}
procedure Log(Item: IPlaylistItem; prefix : String);
var
Source : string;
Target : string;
listener : string;
temp: string;
i: integer;
n:integer;
sl: TStringList;
begin
//Listeneranzahl holen
Source := HTTPGet(‘http://stream.irgendwas.de:7000/7.html’);
i:=1;
n:=1;
while(i<Length(Source)) do begin
Target:=Copy(Source, i, 6);
if(Target = ‘’) then begin
Target:=Copy(Source, i+6, 10); //den html-code ausblenden
while (n<Length(Target)) do begin
temp:=Copy(Target,n,1);
if (temp=’,’) then begin //zahl separieren
listener:= Copy(Target,1,2);
n:=Length(Target); //schleife soll aufhören
end;
n:=n+1;
end;
i:=Length(Source); //schleife soll aufhören
end;
i:=i+1;
end;
sl := TStringList.Create;
// wrap loading in a try…except block in case the file does not exist
try
sl.LoadFromFile(‘c:\log.txt’);
except
end;
sl.Append(prefix+FormatDateTime(‘yyyymmdd hh:nn:ss’, now)+’ : ‘+Item.GetTitle+’ - ‘+Item.GetArtist+’ ___ Listener: '+ listener);
sl.SaveToFile(‘c:\log.txt’);
sl.Free;
end;
procedure OnPlayerStart(PlayerControl: IPlayerControl; Item: IPlaylistItem);
begin
Log(Item, ‘[start]’);
end;
procedure OnPlayerStop(PlayerControl: IPlayerControl; Item: IPlaylistItem);
begin
Log(Item, ‘[stop ]’);
end;
begin
end.[/code]
grüße, michi
edit: ach ja, das ganze ist ein notificatin-script… wie du das einbindest, weisst du oder?