+1 (Animation section)Valentine wrote:Please, can someone write script for http://www.world-art.ru/
Super necessary script for russian anime fans. Please, create it!!!!
+1 (Animation section)Valentine wrote:Please, can someone write script for http://www.world-art.ru/
Code: Select all
// Actors
LineNr := FindLine('Cast overview', Page, 0);
if LineNr = -1 then
LineNr := FindLine('cast overview', Page, 0);
if LineNr = -1 then
LineNr := FindLine('Credited cast', Page, 0);
if LineNr = -1 then
LineNr := FindLine('Complete credited cast', Page, 0);
if LineNr > -1 then
begin
FullValue := '';
Line := Page.GetString(LineNr);
repeat
BeginPos := Pos('<td valign="top">', Line);
if BeginPos > 0 then
begin
Delete(Line, 1, BeginPos);
Line := copy(Line, 25, Length(Line));
BeginPos := pos('">', Line) + 2;
EndPos := pos('</a>', Line);
if EndPos = 0 then
EndPos := Pos('</td>', Line);
Value := copy(Line, BeginPos, EndPos - BeginPos);
if (Value <> '(more)') and (Value <> '') then
begin
BeginPos := pos('.... </td><td valign="top">', Line);
if BeginPos > 0 then
begin
EndPos := pos('</td></tr>', Line);
BeginPos := BeginPos + 27;
Value2 := copy(Line, BeginPos, EndPos - BeginPos);
if Value2 <> '' then
begin
Value := Value + ' (als ' + Value2 + ')';
end;
end;
if FullValue <> '' then
FullValue := FullValue + ', ';
FullValue := FullValue + Value;
end;
EndPos := Pos('</td></tr>', Line);
Delete(Line, 1, EndPos);
end else
begin
Line := '';
end;
until Line = '';
HTMLDecode(FullValue);
SetField(fieldActors, FullValue);
end;
Code: Select all
// Actors
LineNr := FindLine('Cast overview', Page, 0);
if LineNr = -1 then
LineNr := FindLine('cast overview', Page, 0);
if LineNr = -1 then
LineNr := FindLine('Credited cast', Page, 0);
if LineNr = -1 then
LineNr := FindLine('Complete credited cast', Page, 0);
if LineNr > -1 then
begin
FullValue := '';
Line := Page.GetString(LineNr);
repeat
BeginPos := Pos('<td valign="middle">', Line);
if BeginPos > 0 then
begin
Delete(Line, 1, BeginPos);
Line := copy(Line, 25, Length(Line));
BeginPos := pos('">', Line) + 2;
EndPos := pos('</a>', Line);
if EndPos = 0 then
EndPos := Pos('</td>', Line);
Value := copy(Line, BeginPos, EndPos - BeginPos);
if (Value <> '(more)') and (Value <> '') then
begin
BeginPos := pos('.... </td><td valign="middle">', Line);
if BeginPos > 0 then
begin
EndPos := pos('</td></tr>', Line);
BeginPos := BeginPos + 30;
Value2 := copy(Line, BeginPos, EndPos - BeginPos);
if Value2 <> '' then
begin
Value := Value + ' (als ' + Value2 + ')';
end;
end;
if FullValue <> '' then
FullValue := FullValue + ', ';
FullValue := FullValue + Value;
end;
EndPos := Pos('</td></tr>', Line);
Delete(Line, 1, EndPos);
end else
begin
Line := '';
end;
until Line = '';
HTMLDecode(FullValue);
SetField(fieldActors, FullValue);
end;
Code: Select all
function AddMoviesTitles(Page: TStringList; var LineNr: Integer) : string;
var
Line: string;
MovieTitle, MovieAddress: string;
StartPos, EndPos, NumTitles: Integer;
begin
result := '';
Line := Page.GetString(LineNr);
NumTitles := 0;
repeat
StartPos := pos('<a href=''view.php?page=film&fid=', Line);
if StartPos > 0 then
begin
Delete(Line, 1, StartPos + 8);
MovieAddress := copy(Line, 1, pos('''>', Line) - 1);
StartPos := pos('''>', Line) +2;
MovieTitle := copy(Line, StartPos, pos('</a>', Line) - StartPos);
HTMLRemoveTags(MovieTitle);
NumTitles := NumTitles + 1;
PickTreeAdd(MovieTitle , 'http://www.ofdb.de/' + MovieAddress);
end;
until (StartPos < 1);
if NumTitles = 1 then result := 'http://www.ofdb.de/' + MovieAddress;
end;
Code: Select all
function AddMoviesTitles(Page: TStringList; var LineNr: Integer) : string;
var
Line: string;
MovieTitle, MovieAddress: string;
StartPos, EndPos, NumTitles: Integer;
Multi: boolean;
begin
Multi := true;
result := '';
Line := Page.GetString(LineNr);
NumTitles := 0;
repeat
StartPos := pos('<a href=''view.php?page=film&fid=', Line);
if StartPos < 1 then
begin
StartPos := pos('<a href="view.php?page=film&fid=', Line);
Multi := false;
end;
if StartPos > 0 then
begin
Delete(Line, 1, StartPos + 8);
MovieAddress := copy(Line, 1, pos('''>', Line) - 1);
if Multi = false then MovieAddress := copy(Line, 1, pos('">', Line) - 1);
StartPos := pos('''>', Line) + 2;
if Multi = false then StartPos := pos('">', Line) + 2;
MovieTitle := copy(Line, StartPos, pos('</a>', Line) - StartPos);
HTMLRemoveTags(MovieTitle);
NumTitles := NumTitles + 1;
PickTreeAdd(MovieTitle, 'http://www.ofdb.de/' + MovieAddress);
end;
until (StartPos < 1);
if NumTitles = 1 then result := 'http://www.ofdb.de/' + MovieAddress;
end;