Page 3 of 4

Posted: 2007-03-27 13:41:18
by dkov
It works now.

Thank you for the quick help.

Posted: 2007-03-28 17:29:13
by Moerges
Thank you very much for your work. :)

Btw, does picture import work now, or does it still need to be fixed?

Posted: 2007-03-28 18:44:28
by antp
I have no idea if it works or not: I haven't yet checked that part of the script.

Posted: 2007-03-31 15:00:47
by antp
Finished with picture, classification and MPAA rating. Now whole script should work. So I'll wait few days for bug reports, then I'll consider that script as being the "official" one.
https://forum.antp.be/users/antp/IMDB.ifs

Posted: 2007-04-01 02:07:48
by Thermal Ions
Thanks for your work on this Antoine
Image

Posted: 2007-04-01 17:52:14
by Thermal Ions
Been testing out the script a little and came across problem of blank lines in beginning of Comments field, and IMDB TRIVIA heading not being correct (left over text from the actors list is inserted) if Comments field is blank.

Blank lines seems to be fixed by making a change at the end of the Comments section of code.
Change

Code: Select all

    if (GetOption('CommentType') = 2) then
      SetField(fieldComments, #13#10);
to

Code: Select all

    if (GetOption('CommentType') = 2) then
      SetField(fieldComments, '');
IMDB TRIVIA Heading fixed by changing code towards end of the Trivia section.
Change

Code: Select all

      case GetOption('Trivia') of
        1:
          begin
            if GetField(fieldDescription) <> '' then
              Value := GetField(fieldDescription) + #13#10 + #13#10 + 'IMDB TRIVIA: ' + Value
            else
              Value :=  'IMDB ' + Value2 + ': ' + Value;        // <-- changing this line
            SetField(fieldDescription, Value);
          end;
        2:
          begin
            if GetField(fieldComments) <> '' then
              Value := GetField(fieldComments) + #13#10 + #13#10 + 'IMDB TRIVIA: ' + Value
            else
              Value :=  'IMDB ' + Value2 + ': ' + Value;        // <-- changing this line
            SetField(fieldComments, Value);
          end;
to

Code: Select all

      case GetOption('Trivia') of
        1:
          begin
            if GetField(fieldDescription) <> '' then
              Value := GetField(fieldDescription) + #13#10 + #13#10 + 'IMDB TRIVIA: ' + Value
            else
              Value :=  'IMDB TRIVIA: ' + Value;        // <-- changed this line
            SetField(fieldDescription, Value);
          end;
        2:
          begin
            if GetField(fieldComments) <> '' then
              Value := GetField(fieldComments) + #13#10 + #13#10 + 'IMDB TRIVIA: ' + Value
            else
              Value :=  'IMDB TRIVIA: ' + Value;        // <-- changed this line
            SetField(fieldComments, Value);
          end;
Cheers.......Thermal
Thermal's Movie db / TV Series db

Posted: 2007-04-01 18:16:39
by antp
Thanks. These were bugs due to some changes that I made (e.g. Value2 that I didn't use anymore) and I did not test all the cases. I'll apply your code directly ;)
I moved the script to www.antp.be/temp/scripts/IMDB.ifs as I noticed that by mistake a previous temporary version of it was there :ha: Strange that nobody sent me report by e-mail about that script, as it was not working very well.

Posted: 2007-04-01 19:04:12
by LeMoi
Pour un film comme "8 femmes", j'obtiens comme producteur :
Stéphane Célérier, Olivier Delbosc, Marc Missonnier
Normal ?

EDIT : zut quand je colle ici ça passe ^^
à la passe de é, j'ai le code html "é" dans AMC
EDIT 2 : zut ça passe vraiment pas ^^

Posted: 2007-04-01 20:53:27
by antp
& eacute ; sans les espaces ? :D
J'ai rajouté une ligne, ça devrait être corrigé. Il se peut que la même chose se produise pour d'autres champs.

Posted: 2007-04-01 20:56:00
by LeMoi
Oui c'était ça ^^
Merci :)

Posted: 2007-04-04 15:38:13
by tottem
Maybe I,m doing something wrong, but still not getting de director,s name with your script.

I can get director´s name Using the new auto.imdb.com.ifs from HappyTalk, but I prefer yours, I think is faster.

Any help?

thanx

Posted: 2007-04-04 18:04:54
by antp
Fixed: they replaced "Directed by" by "Director:"

Posted: 2007-04-04 18:44:24
by alexch_gr
They also replaced "writing credits" with "writer".

Posted: 2007-04-04 21:57:33
by antp
Thanks

Posted: 2007-04-04 22:18:38
by Moerges
Firstly, thank you, antp, for updating the script. :)

Secondly, I think there's a problem with the Director/Writer part - the site adapts to the number (only one or more than one) of names, so if a movie has more than one Director/Writer, IMDb displays "Directors:/Writers:"

(for example: http://imdb.com/title/tt0249241/)

With "Director:/Writer:" in the script, it wouldn't import the names after "Directors:/Writers:", would it?

Posted: 2007-04-04 22:35:16
by antp
I did it for Writer, now it is done for Director too.

Posted: 2007-04-05 00:19:14
by Moerges
Awesome, thank you! :)

Posted: 2007-04-11 17:38:25
by spanky6666
Hi,

I'm new to this forum but I'm using your Movie Catalog software for many years now and I'm VERY CONTENT with it :-)
Without this fine piece of software my DVD-VHS catalog would be unmanageable!
Especially the zweckform_4737 print option is very neat :-)

Many thanks for your new IMDB-script antp !

Posted: 2007-04-13 16:50:33
by Thermal Ions
Been at it again - fiddling with antp's IMDB script. :shaking:

I found that a spoiler warning sometimes appears in the Trivia list, and presently isn't dealt with very cleanly. To tidy it up insert, the following line:

Code: Select all

      Value := StringReplace(Value, '>>> WARNING: Here Be Spoilers <<<', #13#10 + '>>> WARNING: Here Be Spoilers <<< ');
as follows:

Code: Select all

      Value := StringReplace(Value, '<li>', #13#10 + '- ');
      Value := StringReplace(Value, '>>> WARNING: Here Be Spoilers <<<', #13#10 + '>>> WARNING: Here Be Spoilers <<< ');
      HTMLRemoveTags(Value);
      HTMLDecode(Value);
      case GetOption('Trivia') of
I've also been looking at IMDB's new page layout, and decided it would be pretty easy to adapt antp's Trivia code to have the script also download the Goofs, Crazy Credits, and Movie Connections. So if you want to add this functionality, then feel free to add all of the below sections of code:

I've got too many other personal tweaks in my IMDB script to just link a replacement file - sorry. It's tested on over 150 movies so you could possibly consider implementing it in the standard script if you like Ant.

At the end of the [Options] section:

Code: Select all

Goofs=2|0|0=Do not import goofs|1=Import goofs to Description field, after the summary|2=Import goofs to Comments field, after the comments
MovieConnections=2|0|0=Do not import movie connections|1=Import movie connections to Description field, after the summary|2=Import movie connections to Comments field, after the comments
CrazyCredits=2|0|0=Do not import crazy credits|1=Import crazy credits to Description field, after the summary|2=Import crazy credits to Comments field, after the comments
After the existing call to the Awards procedure, add similar calls to the the new Goofs, Crazy Credits, and Movie Connections procedures:

Code: Select all

  // Awards
  if (GetOption('Awards') > 0) then
  begin
    ImportAwards();
  end;
  
  // Goofs             
  if (GetOption('Goofs') > 0) then
  begin
    ImportGoofs();
  end;

  // Crazy Credits         
  if (GetOption('CrazyCredits') > 0) then
  begin
    ImportCrazyCredits();
  end;

  // Movie Connections     
  if (GetOption('MovieConnections') > 0) then
  begin
    ImportConnections();
  end;
And finally add the following procedures between the end of the ImportAwards procedure and the "// ***** beginning of the program *****"

Code: Select all

// Procedure - ImportGoofs
procedure ImportGoofs;
var
  FullValue, Value : string;
begin
  sleep(50);
  Value := MovieUrl;
  FullValue := GetPage(Value+'/goofs');
  Value := TextBetween(FullValue, '<ul class="trivia">', '<div align="center"> <!--');
  if Value <> '' then
  begin
    Value := StringReplace(Value, #13#10, '');
    while Pos('  ', Value) > 0 do
      Value := StringReplace(Value, '  ', '');
    while Pos('<li> ', Value) > 0 do
      Value := StringReplace(Value, '<li> ', '<li>');
    Value := StringReplace(Value, '<li>', #13#10 + '- ');
    Value := StringReplace(Value, '>>> WARNING: Here Be Spoilers <<<', #13#10 + '>>> WARNING: Here Be Spoilers <<< ');
    HTMLRemoveTags(Value);
    HTMLDecode(Value);
    case GetOption('Goofs') of
      1:
        begin
          if GetField(fieldDescription) <> '' then
            Value := GetField(fieldDescription) + #13#10 + #13#10 + 'IMDB GOOFS: ' + Value
          else
            Value :=  'IMDB GOOFS: ' + Value;
          SetField(fieldDescription, Value);
        end;
      2:
        begin
          if GetField(fieldComments) <> '' then
            Value := GetField(fieldComments) + #13#10 + #13#10 + 'IMDB GOOFS: ' + Value
          else
            Value :=  'IMDB GOOFS: ' + Value;
          SetField(fieldComments, Value);
        end;
    end;
  end;
end;

// Procedure - CrazyCredits
procedure ImportCrazyCredits;
var
  FullValue, Value : string;
begin
  sleep(50);
  Value := MovieUrl;
  FullValue := GetPage(Value+'/crazycredits');
  Value := TextBetween(FullValue, '<pre>', '</pre>');
  if length(Value) > 4 then
  begin
    Value:= StringReplace(Value, #13#10, ' ');
    while Pos('  ', Value) > 0 do
      Value := StringReplace(Value, '  ', '');
      Value := StringReplace(Value, '<br><br>', #13#10 + '- ');
    HTMLRemoveTags(Value);
    HTMLDecode(Value);
    Value := '- ' + FullTrim(Value);
    case GetOption('CrazyCredits') of
      1:
        begin
          if GetField(fieldDescription) <> '' then
            Value := GetField(fieldDescription) + #13#10 + #13#10 + 'IMDB CRAZY CREDITS: ' + #13#10 + Value
          else
            Value :=  'IMDB CRAZY CREDITS: ' + #13#10 + Value;
          SetField(fieldDescription, Value);
        end;
      2:
        begin
          if GetField(fieldComments) <> '' then
            Value := GetField(fieldComments) + #13#10 + #13#10 + 'IMDB CRAZY CREDITS: ' + #13#10 + Value
          else
            Value :=  'IMDB CRAZY CREDITS: ' + #13#10 + Value;
          SetField(fieldComments, Value);
        end;
    end;
  end;
end;

// Procedure - ImportConnections
procedure ImportConnections;
var
  FullValue, Value : string;
begin
  sleep(50);
  Value := MovieUrl;
  FullValue := GetPage(Value+'/movieconnections');
  Value := TextBetween(FullValue, '<div id="tn15content">', '<div align="center"> <!--');
  if Value <> '' then
  begin
    Value := StringReplace(Value, #13#10, '');
    while Pos('  ', Value) > 0 do
      Value := StringReplace(Value, '  ', '');
    Value := StringReplace(Value, '<h5>', #13#10);
    Value := StringReplace(Value, '</h5>', ':' + #13#10);
    Value := StringReplace(Value, '<br/>', #13#10);
    Value := StringReplace(Value, ' -  ', '- ');
    HTMLRemoveTags(Value);
    HTMLDecode(Value);
    Value := FullTrim(Value);
    case GetOption('MovieConnections') of
      1:
        begin
          if GetField(fieldDescription) <> '' then
            Value := GetField(fieldDescription) + #13#10 + #13#10 + 'IMDB MOVIE CONNECTIONS: ' + #13#10 + Value
          else
            Value :=  'IMDB MOVIE CONNECTIONS: ' + #13#10 + Value;
          SetField(fieldDescription, Value);
        end;
      2:
        begin
          if GetField(fieldComments) <> '' then
            Value := GetField(fieldComments) + #13#10 + #13#10 + 'IMDB MOVIE CONNECTIONS: ' + #13#10 + Value
          else
            Value :=  'IMDB MOVIE CONNECTIONS: ' + #13#10 + Value;
          SetField(fieldComments, Value);
        end;
    end;
  end;
end;
Cheers.......Thermal
Thermal's Movie & TV Series db

Posted: 2007-04-13 18:11:28
by antp
Maybe it would be better to try to make a function that works for all these similar page, instead of having a nearly-identical code duplicated?