Imdb script.. pull release month and year

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 script.. pull release month and year

Post by scottdw »

I am using the IMDB script which pulls the year the film was released. How can I have it pull the month as well???


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

Post by bad4u »

If you want to save the release date in a format containing month and year, you will need to import it to another field on AMC, as the year field only supports integer numbers. So where should it be placed ?
scottdw
Posts: 23
Joined: 2004-01-13 19:44:57

Post by scottdw »

It can be placed in Media Label, Source or Borrower. Can it be formatted a certain way??? I would like to have Year then a numbered month if possible like: 200805 for May of 2008. If that's not possible it's fine I will figure it out but first I need it to be imported :D

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

Post by bad4u »

To retrieve and format release date you can use something like

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';
    end;
    Value := RemainingText;
    Year := TextBefore(Value, ' ', '');
    Value := Year + Month;
    SetField(fieldSource, Value);
  end;
Add this code right behind the "Director" part of the script. Don't forget to define the variables "Month" and "Year" as strings on the beginning of "procedure AnalyzeMoviePage". There might be better solutions, but this code example should be quite easy to modify.
scottdw
Posts: 23
Joined: 2004-01-13 19:44:57

Post by scottdw »

That worked perfectly!!!!!!

Thanks so much for taking the time to write that for me, I really appreciate it.

Happy Holidays!!!!
Post Reply