Page 1 of 2

IMDB Import doesn't work anymore

Posted: 2004-01-08 13:08:50
by Mike
can anyone modify the scripts, thanks?

Posted: 2004-01-08 15:14:17
by antp
what's the problem _exactly_ ?
latest available version works fine with most of the movies.

find doesn't work

Posted: 2004-01-08 15:43:54
by Elman
Doesn't work if your name matches more than one movie. Try new Texas Chainsaw Massacre. So I guess 'find' script doesn't work well.

IMDB script

Posted: 2004-01-08 17:07:44
by HIW
IMDb.com changed design of search page.

Posted: 2004-01-08 17:47:31
by antp
hmmm quite strange.
It was working one or two days ago.
I will check that this evening.

Posted: 2004-01-08 20:04:13
by antp
Here are the updated scripts :
http://www.antp.be/temp/IMDB.ifs
http://www.antp.be/temp/IMDB%20(pic).ifs
http://www.antp.be/temp/IMDB%20(large%20pic).ifs
http://www.antp.be/temp/IMDB%20(batch).ifs

If you find movies that show IMDB-related errors (i.e. no about pictures not found on Amazon), do not hesitate to post their title ;)

Posted: 2004-01-08 22:25:24
by ricardopetruza
Thx antp! :)

Posted: 2004-01-08 22:34:04
by ricduarte
Hi, thanks for the updates on the scripts.

One movie I added and did not show the picture: Foolproof (2003)

However, I was able to get a picture running the Yahoo Picture Grap sript just after the imdb script.

Regards,

ricduarte

Posted: 2004-01-09 00:27:28
by Mandos
Thank you very much for the update!

Posted: 2004-01-09 09:10:30
by Elman
Thank you very much. Keep up great work!

Posted: 2004-01-10 17:24:15
by Ikkeee
Very nice dude! :D

Major thank you

Posted: 2004-01-29 11:18:58
by Zbyna
The Large pics isn't working at my AMC.
A Have a version downloaded from links sended last few replies.

Posted: 2004-01-29 14:07:14
by antp
For which movie for example ?
I've tested few and they work...

Posted: 2004-02-06 13:25:13
by Zbyna
You're right it works, mostly, but on "Z pekla stesti" it isn't.
It's just one movie, take it easy. But I thought that it's not working. Sorry.

Posted: 2004-03-21 14:49:49
by Mguel
Hi, I've noticed that on some movies I get: "<a href="plotsummary">(more)</a" at the end of the description. I'm using the http://www.antp.be/temp/IMDB%20(pic).ifs linked on this post with short description (DescriptionToImport = 1; ).

I've investigated a bit and noticed that this happens on pages where the string "Plot Summary:" is found (i.e. for "Prey for Rock & Roll" movie), but not on the ones that it is used instead the "Plot Outline:" (i.e. Gladiator (2002)). Tried to change some things to make it work but can't do it... nor found the answer searching the forums.

Edit: Trying and trying, guessing and guessing, I manage to make it work. :D

As I'm not a programmer I'm not sure if this is correct or is the orthodox way to have it done. Viewing the source of pages in which it didn't work (with plot summary) I saw that the "<a href" (looked in EndPos := pos('<a href', Line); ) was on a new line. So I added the following code to the script after it looked for '<a href' on the same line, but before it looked for '<br><br>' (added and not replaced since I'm not sure if all the "plot summary" ones have the "<a href="plotsummary">(more)</a" on a new line):

if EndPos < 1 then
begin
Line := Line + Page.GetString(LineNr+1);
EndPos := pos('<a href', Line);

...
...
end;

So the final description code is:

Code: Select all

  //Description
  LineNr := FindLine('Plot Summary:', Page, 0);
  if LineNr < 1 then
    LineNr := FindLine('Plot Outline:', Page, 0);
  if LineNr > -1 then
  begin
    Line := Page.GetString(LineNr);
    BeginPos := pos('</b>', Line) + 5;
    EndPos := pos('<a href', Line);
   if EndPos < 1 then
    begin
      Line := Line + Page.GetString(LineNr+1);
    EndPos := pos('<a href', Line);
    if EndPos < 1 then
    begin
      Line := Line + Page.GetString(LineNr+1);
      EndPos := pos('<br><br>', Line);
      if EndPos < 1 then
        EndPos := Length(Line);
    end;
  end;
    Value := copy(Line, BeginPos, EndPos - BeginPos);
    HTMLDecode(Value);
    case DescrImport of
      0:
        begin
          PickListClear;
          PickListAdd(Value);
          GetDescriptions(GetField(fieldURL) + 'plotsummary');
          if PickListExec('Select a description for "' + MovieName + '"', Value) then
            SetField(fieldDescription, Value);
        end;
      1:
        SetField(fieldDescription, Value);
      2:
        SetField(fieldDescription, GetDescriptions(MovieURL + 'plotsummary'));
    end;
  end;
Please correct me if I'm wrong.
Best regards,
Mguel

Posted: 2004-03-21 18:53:13
by antp
hmmm so in some case you get 3 lines ? It may be a problem.
I think it would be better to correct the script this way :

Code: Select all

  //Description
  LineNr := FindLine('Plot Summary:', Page, 0);
  if LineNr < 1 then
    LineNr := FindLine('Plot Outline:', Page, 0);
  if LineNr > -1 then
  begin
    Line := Page.GetString(LineNr);
    BeginPos := pos('</b>', Line) + 5;
    EndPos := pos('<a href', Line);
    if EndPos < 1 then
    begin
      Line := Line + Page.GetString(LineNr+1);
      EndPos := pos('<br><br>', Line);
      if EndPos < 1 then
        EndPos := pos('<a href', Line);
      if EndPos < 1 then
        EndPos := Length(Line);
    end;
    Value := copy(Line, BeginPos, EndPos - BeginPos);
[...]etc.

Posted: 2004-03-21 18:56:00
by antp
But I do not have problems with the version included with latest AMC version actually.
Maybe that the script on my site (in the "temp" folder) is quite old.
Do you use AMC 3.4.3 ? If yes, the script included with this one is the newest one.

Posted: 2004-03-22 11:34:01
by Mguel
Thanks for the code and explanation!

You're right, I use 3.4.2. I didn't update since the changelog was a bug fix with some P4 (which I don't have) and 3.4.2 was working fine for me, so wanted to wait for another release to update.

Nevertheless, for the next time, I'll update the scripts at least (I thought the ones linked here where the latest). ;)

Regards,
Mguel

Posted: 2004-06-01 18:31:52
by prayer
hi,
have one question. just yesterday i used imdb script without any probs
but now, when i try to get info for any movie - it does not return picture.
that's just bug or imdb changes a bit?
ty

Posted: 2004-06-01 19:45:14
by antp
Maybe that IMDB changed, yes, I have the problem too.
I will check that when I've few time.