Welcome, ferofrantisek.
Of course, does not work because it is missing this piece of code
if URL <> '' then
TmpStr := TmpStr + '</link>';or this one piece of code
TmpStr := TmpStr + TransName
+ '</link>';
Now try this, as shown below, it will probably work.
//Original Work: ~ source for example:
http://anidb.net/perl-bin/animedb.pl?show=anime&aid=6517curPos := Pos('">Original Work:</a', HTML);
LogMessage('17 Original Work: ');
if curPos > 0 then begin
EndPos := curPos;
TmpStr := '';
curPos := PosFrom('creatorid=', HTML, curPos);
curPos1 := PosFrom('</tr>', HTML, EndPos)
LogMessage('17.1 zistujem ci zacina cyklus');
while (curPos < curPos1) and (curPos > EndPos) do begin
URL := '
http://anidb.net/perl-bin/animedb.pl?show=creator&creatorid=' + TextBetween(HTML, 'creatorid=', '">', false, curPos);
LogMessage('17.2 Original Work: url '+URL);
TransName := TextBetween(HTML, '">', '</a>', false, curPos);
LogMessage('17.3 zadavam meno '+TransName);
curPos := PosFrom('creatorid=', HTML, curPos);
if TmpStr <> '' then
TmpStr := TmpStr + #13;
if URL <> '' then
TmpStr := TmpStr + '<link url="' + URL + '">';
TmpStr := TmpStr + TransName;
if URL <> '' then
TmpStr := TmpStr + '</link>';
AddCustomFieldValueByName('Original Work:', TmpStr);
end;
end;
or such variant
//Original Work: ~ source for example:
http://anidb.net/perl-bin/animedb.pl?show=anime&aid=6517curPos := Pos('">Original Work:</a', HTML);
LogMessage('17 Original Work: ');
if curPos > 0 then begin
EndPos := curPos;
TmpStr := '';
curPos := PosFrom('creatorid=', HTML, curPos);
curPos1 := PosFrom('</tr>', HTML, EndPos)
LogMessage('17.1 zistujem ci zacina cyklus');
while (curPos < curPos1) and (curPos > EndPos) do begin
URL := '
http://anidb.net/perl-bin/animedb.pl?show=creator&creatorid=' + TextBetween(HTML, 'creatorid=', '">', false, curPos);
LogMessage('17.2 Original Work: url '+URL);
TransName := TextBetween(HTML, '">', '</a>', false, curPos);
LogMessage('17.3 zadavam meno '+TransName);
if TmpStr <> '' then
TmpStr := TmpStr + #13;
if URL <> '' then
TmpStr := TmpStr + '<link url="' + URL + '">';
TmpStr := TmpStr + TransName;
if URL <> '' then
TmpStr := TmpStr + '</link>';
AddCustomFieldValueByName('Original Work:', TmpStr);
curPos := PosFrom('creatorid=', HTML, curPos);
end;
end;