[REQ] OFDb - IMDb (DE)

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.
yeti
Posts: 60
Joined: 2003-09-14 15:50:05

Post by yeti »

No. It's your turn :)
antp
Site Admin
Posts: 9629
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

I received it, thanks to yeti & Bad Joker ;)
Bad Joker
Posts: 81
Joined: 2002-06-10 12:46:38
Location: Hamburg, Germany
Contact:

Post by Bad Joker »

ofdb changed his design (and with that his code) again...

everybody who wants to get the script working again, change the following lines from:

Code: Select all

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;
to:

Code: Select all

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;
you don't see really a change, but the changes are in the quotes. ofdb changed it from two single ' to the quote symbol "

now it should work again.

have fun,

bad joker

EDIT:

ok, the problem was already solved, but not posted in this thread... there is a second solution with both variants of the code:

Code: Select all

function AddMoviesTitles(Page: TStringList; var LineNr: Integer) : string;
var
  Line: string;
  MovieTitle, MovieAddress: string;
  StartPos, EndPos, NumTitles,MK: 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
      StartPos := pos('<a href=''view.php?page=film&fid=', Line);
      MK := 1;
    end;
    if StartPos > 0 then
    begin
      Delete(Line, 1, StartPos + 8);
      if MK = 0 then MovieAddress := copy(Line, 1, pos('">', Line) - 1)
      else MovieAddress := copy(Line, 1, pos('''>', Line) - 1);
      if MK = 0 then StartPos := pos('">', Line) +2
      else 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;
maybe you use this one instead, its more save! it's from Hugo74 and MacLeod found the error! so props goes to them!
mumpel
Posts: 8
Joined: 2006-09-29 19:13:40

Post by mumpel »

I used the second possibility from Hugo74 and Macleod. Actually it now works but I still don't get any actors. Can someone fix this as well, please?

And another request: Can someone fix the OFDB-script since I mostly get my data from there. I need german countries, genres and the rating fits more to my personal opinion. Thanks a lot!
Bad Joker
Posts: 81
Joined: 2002-06-10 12:46:38
Location: Hamburg, Germany
Contact:

Post by Bad Joker »

yes with the actors is a problem of imdb. i looked at it today, but the new imdb script works totally different from the old one so i can't just copy and paste it into ofdb - imdb. somebody has an idea how to start?

it's just the variables are totally different and i can't get the "PageText" var to work with the ofdb - imdb script.

and what do you mean with german countries, genres and rating?

you can translate the most common countries in the script, but that is a lot of work...or more easy in your database, that are a few clicks after importing a movie. same goes with genres...

and what do you mean with rating?
Post Reply