Mijn mooie RSS feed doet niet wat ik wil, kan iemand even kijken naar het DPR file?
(Het is gebaseerd op deze
RSS Feed van de Samurai site.
Het xml file wat ik wil uitlezen heeft meerdere strings die ik wil tonen en heb geprogrammeerd maar hij toont er maar 1. Ik weet niet waar ik een fout maak....
DPR script (ingekort)
// Function to return string between two strings boundaries (get something inside a tag for example)
function GetText(Start: string; Stop: string; Source: string): string;
var
N: Integer;
begin
N := Pos(Start, Source);
Source := Copy(Source, N + Length(Start), Length(Source));
N := Pos(Stop, Source);
GetText := Copy(Source, 1, N - 1);
end;
// Same as above but for second string ('cause it's not working

)
function GetText1(Start: string; Stop: string; Source: string): string;
var
G: Integer;
begin
G := Pos(Start, Source);
Source := Copy(Source, G + Length(Start), Length(Source));
G := Pos(Stop, Source);
GetText1 := Copy(Source, 1, G - 1);
end;
// Function to return a string after one string boundary
function After(Str: string; Source: string): string;
var
N: Integer;
begin
N := Pos(Str, Source);
After := Copy(Source, N + Length(Str), Length(Source));
end;
// Procedure that is given control over some objects to define the DLL usage and functions
function Init(): PChar; stdcall;
begin
Result := 'FetchRSS';
end;
// Procedure to Init the parameters of a function
//work to be done...>insert GetTekst parameters,say 3 from user input now predefined between <etc> and </etc>
function GetParam(Func: PChar): PChar; stdcall;
begin
if Func = 'FetchRSS' then
begin
Result := 'RSS Feed URL|number of news to display(1-30)|Update Interval (in minutes)|';
end;
end;
// The main function

function FetchRSS(Url: PChar; Number: PChar; UpdateInt: PChar): PChar; stdcall;
var
Final, S, G: string; F: string;
I, C: Integer;
begin
if StrStream.Size = 0 then // Is the StringStream empty ? (functions first time run) Then get the file
GetInetFile(Url, StrStream);
if Now >= AddMinutes(LastCall, StrToInt(string(UpdateInt))) then
begin
LastCall := Now;
GetInetFile(Url, StrStream);
end;
C := StrToInt(string(Number));
S := StrStream.DataString;
for I := 1 to C do
begin
F := GetText('<title>', '</title>', S);
G := GetText1('<description>', '</description>', G);
S := GetText('</item>', S);
Final := Final + F + G + '%b';
end;
Result := StrAlloc(Length(Final));
StrCopy(Result, PChar(Final));
end;