unit MainU;
//... blabla
function readout(text, vorne, hinten:
string):
string;
var astring:
string;
begin
astring := copy(text, Pos(vorne, text) + length(Vorne), PosEx(hinten, text, Pos(vorne, text)) - Pos(vorne, text) - length(vorne));
result := astring;
end;
function StringsucheVor(Quelle,anfang,ende:
string):
string;
var i,k,erstestelle: longint ;
ergebnis :
String;
begin
i := 0 ;
k := length(anfang);
ergebnis := '
';
ersteStelle := pos(anfang,Quelle);
if ersteStelle <> 0
then
begin
while copy(Quelle,erstestelle+k+i,1) <> ende
do
begin
ergebnis := ergebnis + copy(Quelle,erstestelle+k+i,1);
inc(i);
end;
end;
result := ergebnis;
end;
function ThreadedHTTP(
URL:
string):
string;
var
cHttp : TidHTTP;
QuellCode :
string;
begin
cHttp := TidHTTP.Create (
Nil);
Try
QuellCode := cHttp.Get(
URL);
Finally
cHttp.Free;
result := QuellCode;
End
End;
procedure GetRadioInfo;
var
//Quellcode der Homepage
QuellCodeTechnobase :
string;
QuellCodeTrancebase :
string;
QuellCodeHardbase :
string;
QuellCodeHousetime :
string;
//Technobase
TechnobaseModerator :
string;
TechnobaseShow :
string;
TechnobaseStyle :
string;
TechnobaseListener :
string;
TechnobaseTrack :
string;
//Trancebase
TrancebaseModerator :
string;
TrancebaseShow :
string;
TrancebaseStyle :
string;
TrancebaseListener :
string;
TrancebaseTrack :
string;
//Hardbase
HardbaseModerator :
string;
HardbaseShow :
string;
HardbaseStyle :
string;
HardbaseListener :
string;
HardbaseTrack :
string;
//Housetime
HousetimeModerator :
string;
HousetimeShow :
string;
HousetimeStyle :
string;
HousetimeListener :
string;
HousetimeTrack :
string;
begin
QuellCodeTechnobase := ThreadedHTTP('
http://www.technobase.fm');
QuellCodeTrancebase := ThreadedHTTP('
http://www.trancebase.fm');
QuellCodeHardbase := ThreadedHTTP('
http://www.hardbase.fm');
QuellCodeHousetime := ThreadedHTTP('
http://www.housetime.fm');
TechnobaseListener := StringSucheVor(QuellCodeTechnobase, '
TechnoBase</a>:</td><td>', '
<');
frmMain.lblTechnobaseListener.caption := TechnobaseListener;
TechnobaseModerator := StringSucheVor(QuellCodeTechnobase, '
target="_top"><span style="color:#FFDD82">', '
<');
frmMain.lblTechnobaseModerator.Caption := TechnobaseModerator;
TechnobaseShow := StringSucheVor(QuellCodeTechnobase, '
/span></a><span style="color:#DFB649"> mit "', '
"');
frmMain.lblTechnobaseShow.Caption := TechnobaseShow;
TechnobaseStyle := StringSucheVor(QuellCodeTechnobase, '
"</span><span style="color:#DFB649"> (', '
)');
frmMain.lblTechnobaseStyle.Caption := TechnobaseStyle;
TechnobaseTrack := StringSucheVor(QuellCodeTechnobase, '
<div style="width:345px;float:left; margin-top:11px; overflow:hidden">', '
<');
frmMain.lblTechnobaseTrack.Caption := Trim(TechnobaseTrack);
//---
HardbaseListener := StringSucheVor(QuellCodeHardbase, '
HardBase</a>:</td><td>', '
<');
frmMain.lblHardbaseListener.caption := HardbaseListener;
HardbaseModerator := StringSucheVor(QuellCodeHardbase, '
target="_top">', '
<');
frmMain.lblHardbaseModerator.caption := HardbaseModerator;
HardbaseShow := StringSucheVor(QuellCodeHardbase, '
</a> mit "', '
"');
frmMain.lblHardbaseShow.caption := HardbaseShow;
HardbaseStyle := StringSucheVor(QuellCodeHardbase, '
" (', '
)');
frmMain.lblHardbaseStyle.caption := HardbaseStyle;
HardbaseTrack := StringSucheVor(QuellCodeHardbase, '
<div style="width:345px;float:left; margin-top:11px; overflow:hidden">', '
<');
frmMain.lblHardbaseTrack.Caption := Trim(HardbaseTrack);
//---
HousetimeListener := StringSucheVor(QuellCodeHousetime, '
HouseTime</a>:</td><td>', '
<');
frmMain.lblHousetimeListener.caption := HousetimeListener;
HousetimeModerator := StringSucheVor(QuellCodeHousetime, '
target="_top">', '
<');
frmMain.lblHousetimeModerator.Caption := HousetimeModerator;
HousetimeShow := StringSucheVor(QuellCodeHousetime, '
</a> mit "', '
"');
frmMain.lblHousetimeShow.Caption := HousetimeShow;
HousetimeStyle := StringSucheVor(QuellCodeHousetime, '
" (', '
)');
frmMain.lblHousetimeStyle.Caption := HousetimeStyle;
HousetimeTrack := StringSucheVor(QuellCodeHousetime, '
<div style="width:345px;float:left; margin-top:11px; overflow:hidden">', '
<');
frmMain.lblHousetimeTrack.Caption := Trim(HousetimeTrack);
//---
TrancebaseListener := StringSucheVor(QuellCodeTrancebase, '
TranceBase</a>:</td><td>', '
<');
frmMain.lblTrancebaseListener.caption := TrancebaseListener;
TrancebaseModerator := StringSucheVor(QuellCodeTrancebase, '
target="_top">', '
<');
frmMain.lblTrancebaseModerator.Caption := TrancebaseModerator;
TrancebaseShow := StringSucheVor(QuellCodeTrancebase, '
</a> mit "', '
"');
frmMain.lblTrancebaseShow.Caption := TrancebaseShow;
TrancebaseStyle := StringSucheVor(QuellCodeTrancebase, '
" (', '
)');
frmMain.lblTrancebaseStyle.Caption := TrancebaseStyle;
TrancebaseTrack := StringSucheVor(QuellCodeTrancebase, '
<div style="width:345px;float:left; margin-top:11px; overflow:hidden">', '
<');
frmMain.lblTrancebaseTrack.Caption := Trim(TrancebaseTrack);
end;
procedure TfrmMain.TimerGetRadioInfoTimer(Sender: TObject);
begin
GetRadioInfo;
end;
end.