English > Scripts and Templates

AllMovie+(Ivek23)

<< < (2/3) > >>

Ivek23:
Ok,Thanks

Ivek23:
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: ---//Duration
 curPos := PosFrom('">', HTML, EndPos) + 2;
 EndPos := PosFrom(' ', HTML, curPos);
 
 AddFieldValue(mfDuration, Copy(HTML, curPos, EndPos - curPos));
 
 LogMessage('Duration:' + Copy(HTML, curPos, EndPos - curPos));
--- End code ---

Replace with this code

--- Code: --- //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));

--- End code ---

and got into custom items Original duration.

Ivek23:
I will also shortly be uploaded image here

Ivek23:
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: --- //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;

--- End code ---

//      Sound by            Sound by         short text

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




--- Code: --- //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;

--- End code ---

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.

Ivek23:
//  %*   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

--- End quote ---
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: --- //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;
--- End code ---

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version