Modifying IMDB script

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
doveman
Posts: 32
Joined: 2011-09-17 09:58:35

Modifying IMDB script

Post by doveman »

I use AMC and Myfilms/AMCU and I'd like to make the grabbing consistent between them.

AMCU puts the Classification in a Custom field "Classification" so I'd like to make AMC's IMDB script do the same. At the moment it offers the option to put it in the Media Label or Comments field, but I want to use the Media Label field for it's proper purpose and want the Classification in it's own field, rather than comments, so that I can sort/group by it.

AMCU also puts the Tagline in a Custom field. I'm not decided on whether I prefer that or having it at the start of the Description, as AMC does now, but I'd like to know how to modify the AMC IMDB script to put the Tagline in the Custom field if I decide to.
antp
Site Admin
Posts: 9629
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

AMCU = http://sourceforge.net/projects/amcupdater/ ? (I found that with Google, I didn't even know it existed)

For the IMDB script, you could search where it sets the value (using SetField) and replace that by a SetCutomField call.
e.g. if there is a
SetField(fieldMedia, SomeVariable);
you could put
SetCustomField('ClassificationFieldTag', SomeVariable);
where SomeVariable is the variable used in the script
and ClassificationFieldTag is the tag associated to the custom field (to be put with the quotes)
doveman
Posts: 32
Joined: 2011-09-17 09:58:35

Post by doveman »

Sorry, I would have clarified but I thought you'd be aware of AMCU already ;)

Thanks for the tips, I'll have a look at the IMDB script and see if I can modify it to suit my preference.
doveman
Posts: 32
Joined: 2011-09-17 09:58:35

Post by doveman »

OK, looks like the relevant section is

Code: Select all

              if GetOption('Classification') > 0 then
  begin
    if UserCountry = '' then
      ShowMessage('Country not set for classification selection - Click "Editor" tab in the scripting window, then select your country by modifying the required line as explained in the first lines of the code')
    else
    begin
      Value := TextBetween(PageText, '<a href="/search/title?certificates=', '</div>');
      Value := TextBetween(Value, UserCountry + ':', '</a>');      if Value <> '' then
      begin
        if GetOption('Classification') = 1 then
          SetField(fieldMediaType, Value)
        else
         SetField(fieldComments, GetField(fieldComments) + #13#10 + #13#10 + 'Classification: ' + Value);
      end;
so if I set Classification setting to 1 then can I just modify the latter part to:

Code: Select all

      begin 
        if GetOption('Classification') = 1 then 
          SetCustomField('Certification', Value) 
        else 
         SetField(fieldComments, GetField(fieldComments) + #13#10 + #13#10 + 'Classification: ' + Value); 
      end;
where Certification is the custom field?
antp
Site Admin
Posts: 9629
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

Yes, it should work
doveman
Posts: 32
Joined: 2011-09-17 09:58:35

Post by doveman »

Cool, I tested and it works great :)
spiderman
Posts: 51
Joined: 2008-08-14 17:58:38

import studio / production company

Post by spiderman »

I would like an import function for production company.

thanks in advanced
Post Reply