IMDB Release Date script fix

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
scottdw
Posts: 23
Joined: 2004-01-13 19:44:57

IMDB Release Date script fix

Post by scottdw »

I have this script to pull the release date of a movie from IMDB:

Code: Select all

// Release Date
  if CanSetField(fieldSource) then
  begin
    Value := TextBetween(PageText, '<h5>Release Date:</h5>', '<');
    Value := TextBetween(Value, #13#10, #13#10);
    Value := TextAfter(Value, ' ');
    Month := TextBefore(Value, ' ', '');
    case Month of
      'January':    Month := '01';
      'February':   Month := '02';
      'March':      Month := '03';
      'April':      Month := '04';
      'May':      Month := '05';
      'June':      Month := '06';
      'July':      Month := '07';
      'August':      Month := '08';
      'September':      Month := '09';
      'October':      Month := '10';
      'November':      Month := '11';
      'December':      Month := '12';
    end;
    Value := RemainingText;
    Year := TextBefore(Value, ' ', '');
    Value := Year + Month;
    SetField(fieldSource, Value);
  end;
I just put it in my IMDB script and it was working for a while. I have updated the IMDB script and added this back in but it still does not work.
It formats is like this: 200910 for Oct of 2009.

This worked for while but does not anymore. I am sure it is something simple that IMDB changed that makes this no longer work.

Can someone take a quick look and see if you can figure it out...I tried but don't understand.


Thanks alot!

Scott
bad4u
Posts: 1148
Joined: 2006-12-11 22:54:46

Post by bad4u »

Change

Code: Select all

    Value := TextBetween(PageText, '<h5>Release Date:</h5>', '<');
    Value := TextBetween(Value, #13#10, #13#10);
to

Code: Select all

    Value := TextBetween(PageText, '<h5>Release Date:</h5>', '</div>');
    Value := TextBetween(Value, '<div class="info-content">' + #13#10, #13#10);
and it should do the job. Please test for yourself.
scottdw
Posts: 23
Joined: 2004-01-13 19:44:57

Post by scottdw »

That worked!!!


Thanks so much.
Post Reply