Personal Video Database

English => Development => Scripts and Templates => Topic started by: Ivek23 on April 14, 2010, 01:37:59 pm

Title: AllMovie+(Ivek23)
Post by: Ivek23 on April 14, 2010, 01:37:59 pm
The AllMovie site has been replaced by AllRovi.
See AllRovi movie script (http://www.videodb.info/forum_en/index.php/topic,2487.msg12988.html#msg12988) for Scripts and Templates board. (http://www.videodb.info/forum_en/index.php/board,9.0.html)
Post it now in AllRovi movie script (http://www.videodb.info/forum_en/index.php/topic,2496.msg13093.html#msg13093) for  Support board. (http://www.videodb.info/forum_en/index.php/board,1.0.html)



Here is my version and

AllMovie + (Ivek23) script.

Code: [Select]
CUSTOM FIELD mappings
Code: [Select]

//  %* ALLMOVIE CAPTION PVD FIELD FIELD TYPE

// Production Credits Tab      Production memo
// Review Tab Review memo
//  99 Run time Original duration number
//  98 Work rating AllMovie rating rating
//  52 Attributes Attributes multiselect list
//  70 MPAA + MPAA Reasons Mpaa rate memo
//  99 Category Work type select list
//  99 Color type Color type select list
//  99 Types Types multiselect list
//  93 Flags Flags multiselect list
//  99 Keywords Keywords memo
//  97 Themes Category memo
//  98 Tones Tones memo
//  74 Moods Moods multiselect list
//  20 From book (or story) Book short text
//  42 Set in Set in multiselect list
//  89 Box office Money short text
//  99 Produced by Studios memo
//  49 Release (or Premiere) Released short text
//  60 Released by Released by memo
//   0   (Date) Updated short text


Code: [Select]
Percent present in Ivek23's personal database
[attachment deleted by admin]
Title: Re: AllMovie+(Ivek23)
Post by: Ivek23 on April 14, 2010, 02:11:52 pm
Custom items in this list and work.
Title: Re: AllMovie+(Ivek23)
Post by: rick.ca on April 14, 2010, 09:12:20 pm
Just so others are not confused...This is not a fundamentally different version of my Allmovie+ (http://www.videodb.info/forum_en/index.php?topic=1232.msg4393#msg4393) script. It is, rather, an adaptation—in the manner my script was meant to be adapted.

As a modification of the nostra's original script, the general purpose of Allmovie+ is to make available as many additional data elements as possible. Following is the preamble in the script (it precedes the field mapping table presented above)...

Quote
CUSTOM AND NON-STANDARD FIELD MAPPINGS

All custom fields are optional. All standard fields can be suppressed using Preferences-Plugins-Overwrite fields. If custom names are changed in PVD, they must also be changed where they occur in the body of this script. The type of custom field used is also somewhat a matter of personal preference. A list which is for viewing only will do just as well in a long text as a multiselect field.

It is up to the user of the script to decide what fields the additional data is written to—thus the mapping table in the documentation. Where the field type (standard vs. custom) is changed from the "default," it is necessary to modify the code in the script. For example, Ivek wants Allmovie's "Tones" to be written to a custom field Tones instead of the standard field Tags. So he has changed...

AddFieldValue(mfTags, HTMLValues(HTML, to
AddCustomFieldValueByName('Tones', HTMLValues(HTML,.
Title: Re: AllMovie+(Ivek23)
Post by: Ivek23 on April 15, 2010, 05:57:33 am
I hope that the apology be accepted.

You are right is not new.Of course,therefore,my deep sorry for this great stupid
error.

BTW:
Other things I wanted to be helpful.
Title: Re: AllMovie+(Ivek23)
Post by: rick.ca on April 15, 2010, 07:00:12 am
No apology is necessary, Ivek. I just want others to understand it's one script that needs to be modified to suit the user's particular needs. I'm sorry I didn't thank you for demonstrating how that is done.
Title: Re: AllMovie+(Ivek23)
Post by: Ivek23 on April 15, 2010, 07:12:22 am
Ok,Thanks
Title: Re: AllMovie+(Ivek23)
Post by: Ivek23 on April 15, 2010, 05:53:28 pm
I also edited the original script AllMovie but I do not published.

If someone is interested in you can get the code and how I edited the custom items.

List what I changed:

Rating            Stay that way
MPAA             --->transferred to AllMovie + (Ivek23) script
Aka                --->transferred to AllMovie + (Ivek23) script
Genre             --->transferred to AllMovie + (Ivek23) script
Tags               --->transferred to AllMovie + (Ivek23) script
Studio            --->transferred to AllMovie + (Ivek23) script
Box office       --->transferred to AllMovie + (Ivek23) script


Perhaps I changed something in the future I informed at least I hope.

Duration        (--->transferred to AllMovie + (Ivek23) script)

Here's the code

Code: [Select]
//Duration
 curPos := PosFrom('">', HTML, EndPos) + 2;
 EndPos := PosFrom(' ', HTML, curPos);
 
 AddFieldValue(mfDuration, Copy(HTML, curPos, EndPos - curPos));
 
 LogMessage('Duration:' + Copy(HTML, curPos, EndPos - curPos));

Replace with this code
Code: [Select]
//Duration
 curPos := PosFrom('">', HTML, EndPos) + 2;
 EndPos := PosFrom(' ', HTML, curPos);
 
 AddCustomFieldValueByName('Original Duration', Copy(HTML, curPos, EndPos - curPos));  
 
 LogMessage('Duration:' + Copy(HTML, curPos, EndPos - curPos));

and got into custom items Original duration.
Title: Re: AllMovie+(Ivek23)
Post by: Ivek23 on April 15, 2010, 05:59:33 pm
I will also shortly be uploaded image here (http://www.videodb.info/forum_en/index.php?topic=1846.0)
Title: Re: AllMovie+(Ivek23)
Post by: Ivek23 on April 25, 2010, 12:57:19 pm
In AllMovie + (Ivek23), I added this:

//  %*   ALLMOVIE CAPTION      PVD FIELD         FIELD TYPE

//      Sound by            Sound by         short text
//      Ratio               Aspect Min         short text
//      Production Credits Tab         Production         memo

Here,where this copy it works:

//      Ratio               Aspect Min         short text

//Ratio
 EndPos := PosFrom('style="width: 86px;', HTML, EndPos);
 curPos := PosFrom('">', HTML, EndPos) + 2;
 EndPos := PosFrom('</td>', HTML, curPos);
 AddCustomFieldValueByName('Aspect Min', Copy(HTML, curPos, EndPos - curPos));



Code: [Select]
//Year
 curPos := PosFrom('allmovie.com/explore/year/', HTML, EndPos);
 if curPos < PosFrom('min.', HTML, EndPos) then begin
  EndPos := PosFrom('">', HTML, curPos);
 
  AddCustomFieldValueByName('Year', Copy(HTML, curPos + Length('allmovie.com/explore/year/'), 4));
  
  EndPos := EndPos + 1;
 end else
  EndPos := PosFrom('">', HTML, curPos) + 1;

 //Ratio
 EndPos := PosFrom('style="width: 86px;', HTML, EndPos);
 curPos := PosFrom('">', HTML, EndPos) + 2;
 EndPos := PosFrom('</td>', HTML, curPos);
 AddCustomFieldValueByName('Aspect Min', Copy(HTML, curPos, EndPos - curPos));


 //Duration
 curPos := PosFrom('">', HTML, EndPos) + 2;
 EndPos := PosFrom(' ', HTML, curPos);
 
// AddFieldValue(mfDuration, Copy(HTML, curPos, EndPos - curPos)); // Changed to:
AddCustomFieldValueByName('Original Duration', Copy(HTML, curPos, EndPos - curPos));  
 
 
 //Rating
 AddCustomFieldValueByName('AllMovie rating', '0');
 curPos := PosFrom('<img src="/img/st_r', HTML, EndPos);
 if curPos > 0 then begin
  curPos := PosFrom('alt="', HTML, curPos) + 5;
  EndPos := PosFrom(' ', HTML, curPos);
  
  AddCustomFieldValueByName('AllMovie rating', FloatToStr(StrToFloat(Copy(HTML, curPos, EndPos - curPos)) * 2));  
  
 end else
  curPos := EndPos;

//      Sound by            Sound by         short text

//Sound by
 AddCustomFieldValueByName('Sound by', HTMLValues(HTML,
                             '<span>Sound by</span>', '</table>',
                          '<li>', '</li>',
                          ', ', EndPos));




Code: [Select]
//From book
 AddCustomFieldValueByName('Book', HTMLValues(HTML,
                             '<span>From book</span>', '</table>',
                '<li>', '</li>',
                ', ', EndPos));


 //From story
 AddCustomFieldValueByName('Book', HTMLValues(HTML,
                             '<span>From story</span>', '</table>',
                '<li>', '</li>',
                ', ', EndPos));


//Sound by
 AddCustomFieldValueByName('Sound by', HTMLValues(HTML,
                             '<span>Sound by</span>', '</table>',
                '<li>', '</li>',
                ', ', EndPos));


 //Set in
 AddCustomFieldValueByName('Set in', HTMLValues2(HTML,
                             '<span>Set In</span>', '</table>',
                'http://www.allmovie.com/search/tag', '</a>',
                ', ', EndPos));


 //Box office
 curPos := PosFrom('<span>Box office</span>', HTML, EndPos);
 if curPos > 0 then begin
  curPos := PosFrom('<li>', HTML, curPos) + 5;
  EndPos := PosFrom('</li>', HTML, curPos);
  
  TmpStr := Copy(HTML, curPos, EndPos - curPos);
  curPos := Pos('/', TmpStr);
  if curPos > 0 then
   Delete(TmpStr, curPos, Length(TmpStr) - curPos + 1);
  curPos := Pos(':', TmpStr);
  if curPos > 0 then
   Delete(TmpStr, curPos, Length(TmpStr) - curPos + 1);
  AddCustomFieldValueByName('Money', TmpStr);
 end;

My advice to View:
starting with this AllMovie + (Ivek23) script,then this original script AllMovie
because otherwise you will AllMovie + (Ivek23) script delete Original duration
it appears that you AllMovie original script.

Title: Re: AllMovie+(Ivek23)
Post by: Ivek23 on May 01, 2010, 10:32:50 am
//  %*   ALLMOVIE CAPTION      PVD FIELD         FIELD TYPE

//      Sound by            Sound by         short text
//      Ratio               Aspect Min         short text  replaced by
//      Run Time             Run Time         short text
//      Production Credits Tab         Production         memo

Here is
Quote
//      Ratio               Aspect Min         short text
replaced by this

//      Run Time               Run Time         short text

This is also here

//Run Time  
 EndPos := PosFrom('style="width: 86px;', HTML, EndPos);
 curPos := PosFrom('">', HTML, EndPos) + 2;
 EndPos := PosFrom('</td>', HTML, curPos);
 AddCustomFieldValueByName('Run Time', Copy(HTML, curPos, EndPos - curPos));


Code: [Select]
//Year
 curPos := PosFrom('allmovie.com/explore/year/', HTML, EndPos);
 if curPos < PosFrom('min.', HTML, EndPos) then begin
  EndPos := PosFrom('">', HTML, curPos);
 
  AddCustomFieldValueByName('Year', Copy(HTML, curPos + Length('allmovie.com/explore/year/'), 4));
  
  EndPos := EndPos + 1;
 end else
  EndPos := PosFrom('">', HTML, curPos) + 1;

 //Run Time  
 EndPos := PosFrom('style="width: 86px;', HTML, EndPos);
 curPos := PosFrom('">', HTML, EndPos) + 2;
 EndPos := PosFrom('</td>', HTML, curPos);
 AddCustomFieldValueByName('Run Time', Copy(HTML, curPos, EndPos - curPos));


 //Duration
 curPos := PosFrom('">', HTML, EndPos) + 2;
 EndPos := PosFrom(' ', HTML, curPos);
 
// AddFieldValue(mfDuration, Copy(HTML, curPos, EndPos - curPos)); // Changed to:
AddCustomFieldValueByName('Original Duration', Copy(HTML, curPos, EndPos - curPos));  
 
 
 //Rating
 AddCustomFieldValueByName('AllMovie rating', '0');
 curPos := PosFrom('<img src="/img/st_r', HTML, EndPos);
 if curPos > 0 then begin
  curPos := PosFrom('alt="', HTML, curPos) + 5;
  EndPos := PosFrom(' ', HTML, curPos);
  
  AddCustomFieldValueByName('AllMovie rating', FloatToStr(StrToFloat(Copy(HTML, curPos, EndPos - curPos)) * 2));  
  
 end else
  curPos := EndPos;
Title: Re: AllMovie+(Ivek23)
Post by: Ivek23 on May 13, 2010, 03:17:26 pm
A few post up here (http://www.videodb.info/forum_en/index.php?topic=1870.msg9111#msg9111) I changed (transferred) from original script AllMovie to AllMovie + (Ivek23) script.

Here, repair back to original as it was before the change.

Studio            --->back to the original
Box office        --->back to the original
Aka                --->back to the original
Genre             --->back to the original
Tags              --->back to the original
MPAA             --->back to the original   

Other and left changed so as is was.

Rating          
Duration
        
Title: Re: AllMovie+(Ivek23)
Post by: Ivek23 on May 28, 2010, 06:53:04 am
Here I added yet the script (Blue and green):

//  %*   ALLMOVIE CAPTION      PVD FIELD         FIELD TYPE

//      Genre               Genre            memo
//      Aka               Aka                  memo
//      Country            Country               long text
//      Title                     Title               long text
//      From Comic by         From Comic by             short text
//      From screenplay         From screenplay             short text
//      From material by         From material             short text
//      Film Basis            Film Basis                 short text
//      Negative Format         Negative Format              short text
//      Languages            Language                  short text
//      From Idea by         From Idea by               short text
//        From story            Story                     short text
//      Movie budget         Movie budget               short text
//        Premiere             Premiere                   short text   
//      From TV series         From TV series                short text
//      Alternate Rating         Alternate Rating                short text
//      Video Distributor         Video Distributor                 memo
//      Characters by         Characters by                 short text
//      .S. State            S. State                    short text
//      Region            Regions                    short text
//      Key name            Key name                    short text
//      From play            From play                    memo
//      Filming location         Filming location          multiselect list
//      Color type            Colors types                select list
//      Cinematic Process      Cinematic Process             select list

//      Sound by            Sound by      short text
//      Run Time            Run Time                    short text


Purple                 mean       AddFieldValue Change to AddCustomFieldValueByName
Blue                    mean                 New published
Green                 mean             published some post here (http://www.videodb.info/forum_en/index.php?topic=1870.msg9254#msg9254) and here (http://www.videodb.info/forum_en/index.php?topic=1870.msg9380#msg9380)

It works fine except in those cases when the two additions together (Which are individually works OK) on AllMovie website, the script is incorrectly classified.

Please anyone it what Addition may incorrectly works that write the title of the Film or link to Film on AllMovie Web page and I will then Tues may also Corrected the script.

Added is also script for testing.

Thanks for the suggestions on the script.

[attachment deleted by admin]
Title: Re: AllMovie+(Ivek23)
Post by: Ivek23 on October 17, 2010, 05:02:26 pm
Modified version of the script AllMovie+ -Ivek23- script (http://www.videodb.info/forum_en/index.php?topic=2130.0)
Title: Re: AllMovie+(Ivek23)
Post by: Ivek23 on May 03, 2011, 02:53:29 pm
Attention to important:

AllMovie script do not work anymore.
Title: Re: AllMovie+(Ivek23)
Post by: rick.ca on July 13, 2011, 08:18:38 am
The AllMovie site has been replaced by AllRovi. See AllRovi movie script (http://www.videodb.info/forum_en/index.php/topic,2487.msg12988.html#msg12988).