[REL]Actors-IMDb

If you made a script you can offer it to the others here, or ask help to improve it. You can also report here bugs & problems with existing scripts.
Post Reply
liv
Posts: 1
Joined: 2005-12-19 01:20:42

[REL]Actors-IMDb

Post by liv »

Hello,

Im trying to modify the IMDb script so that i can search/add actors but with no luck; beeing not much of a programmer i was wondering did anyone else try that ? Can anyone point me what variables need to be changed ? For start i belive (though not 100% sure) these are the sections that must be modified:

Code: Select all

/ ***** analyzes the results page that asks to select a movie from a list *****

procedure AnalyzeResultsPage(Address: string);
var
  PageText: string;
  Value: string;
begin
  PageText := GetPage(Address);
  if pos('<title>IMDb', PageText) = 0 then
  begin
    AnalyzeMoviePage(PageText)
  end
  else
  begin
    if Pos('<b>No Matches.</b>', PageText) > 0 then
    begin
      if GetOption('BatchMode') = 0 then
        ShowMessage('No movie found for this search');
      Exit;
    end;
    if GetOption('BatchMode') = 0 then
    begin
      PickTreeClear;
      repeat
        Value := TextBefore(PageText, '<ol>', '<b>');
        if Value <> '' then
        begin
          HTMLRemoveTags(Value);
          HTMLDecode(Value);
          PickTreeAdd(Value, '');
        end;
        Value := TextBetween(PageText, '<ol>', '</ol>');
        PageText := RemainingText;
      until not AddMovieTitles(Value);
      Value := TextBefore(PageText, '"><b>more titles</b></a>', '<a href="');
      if Value <> '' then
        PickTreeMoreLink('http://us.imdb.com' + Value);
      if PickTreeExec(Address) then
        AnalyzeResultsPage(Address);
    end
    else
    begin
      Value := TextBetween(TextBetween(PageText, '<ol>', '</ol>'), '<li>', '</li>');
      if Value <> '' then
        AnalyzeResultsPage(TextBetween(Value, '<a href="', '">'));
    end;
  end;
end;
and

Code: Select all

// ***** adds the titles contained in <ol>'s items *****

function AddMovieTitles(List: string): Boolean;
var
  Value: string;
  Address: string;
begin
  Result := False;
  Value := TextBetween(List, '<li>', '</li>');
  List := RemainingText;
  while Value <> '' do
  begin
    Address := TextBetween(Value, '<a href="', '">');
    HTMLRemoveTags(Value);
    HTMLDecode(Value);
    PickTreeAdd(Value, 'http://us.imdb.com' + Address);
    Result := True;
    Value := TextBetween(List, '<li>', '</li>');
    List := RemainingText;
  end;
end;
Thanks in advance
Post Reply