English > Scripts and Templates

AllRovi movie script

<< < (24/26) > >>

rick.ca:
Sorry for the ranting. Hopefully this solves the issue. But please do look for more odd-ball movies. If there are any sole 'Review' or 'Releases' pages serving as main pages, I'd like to confirm they're properly handled too.

Version 16 attached (and to top post). Changes:

• fixed handing of issue where 'Cast and Crew' serves as the main page
• ...similar fix for sole 'Review' or 'Releases' pages, but haven't found any yet
• changed 'Poster' so .GIF image is no longer downloaded
• ...normally 'no-poster' placeholders

[attachment deleted by admin]

minolotus:

--- Quote from: rick.ca on August 01, 2011, 02:03:55 am ---..., but I hope you guys appreciate how many brain cells this is costing me... ;)

--- End quote ---
Yes, we do. Thanks again for you effort. The script helps me a lot to keep track of my movies.

And we will keep your lost brain cells in font memory  ;D

A minor issue: I think there is no comment in the script what the rick_ca option includes. The only remark I could find is related to the themes. But looking at the code I assume that this option affects also other thinks? If this is true I would suggest to add a separate comment in the upper part of the script.

Ivek23:

--- Quote ---Sorry for the ranting.
--- End quote ---

The following code

--- Code: ---//Title
//modified by rick.ca 07/10/2011
//modified by Ivek23 08/01/2011
curPos := Pos('<title>', HTML) + Length('<title>');
endPos := PosFrom('- Cast, Reviews, Summary, and Awards - AllRovi</title>', HTML, curPos);
TmpStr1 := Copy(HTML, curPos, endPos - curPos)

if TmpStr1 <> '' then

AddFieldValue(mfTitle, TmpStr1);  
AddCustomFieldValueByName('Title', TmpStr1);

if TmpStr1 <> 'title' then
LogMessage('No Title available')
else

curPos := Pos('<title>', HTML) + Length('<title>');
endPos := PosFrom('- Cast and Crew - AllRovi</title>', HTML, curPos);
TmpStr3 := Copy(HTML, curPos, endPos - curPos)

if TmpStr3 <> '' then

AddFieldValue(mfTitle, TmpStr3);  
AddCustomFieldValueByName('Title', TmpStr3);

--- End code ---

is added back to the movie title in the custom field and "Rovi rating" again returns to its place in the rating box. With a similar code would also have movie title also recovered in the "Review or Releases".

rick.ca:

--- Quote from: minolotus on August 01, 2011, 07:49:12 pm ---And we will keep your lost brain cells in font memory  ;D

--- End quote ---

That should be enough for the number that survived. I'm NOT a programmer! :-\


--- Quote ---I think there is no comment in the script what the rick_ca option includes.
--- End quote ---

I assumed you'd search the code for 'RICK_CA' and see what it does, but I suppose this is more humane... ;)


--- Quote ---Please note the existence of 'User Options' in the body of the script below. Set those to 'True' or 'False' as explained there. One of those, RICK_CA, is for the personal preferences of rick.ca, where they differ from those of Ivek23. Those are...

      •   add footers in the form, "—Author" to ~mfDescription~ and ~Review~
      ...used instead of headers.
      
      •   save just a link to 'Releases' page in ~mfFeatures~
      ...used instead of saving entire page to custom field;
      ...as this still requires use of links to view specific DVD information.
      
      •   display LogMessage that these options are being used.
--- End quote ---

But when I look at this, it seems rather silly. If Ivek would just concede my Description and Review are much prettier than his, we could do away with this confusing option. If the Releases link is not wanted, mfFeatures can be disabled in  Overwrite fields..., so it's not necessary for that. What do you say, Ivek?

rick.ca:

--- Quote from: Ivek23 on August 01, 2011, 10:28:28 pm ---
The following code...is added back to the movie title in the custom field and "Rovi rating" again returns to its place in the rating box.
--- End quote ---

Does this work? It seems to, but I don't use either field... :-\


--- Code: ---//~mfTitle~ or ~Title~

curPos := Pos('<title>', HTML) + Length('<title>');

if Pos('- Cast, Reviews, Summary, and Awards - AllRovi</title>', HTML) > 0 then
endPos := PosFrom('- Cast, Reviews, Summary, and Awards - AllRovi</title>', HTML, curPos)
else
endPos := PosFrom('- Cast and Crew - AllRovi</title>', HTML, curPos);
TmpStr1 := Copy(HTML, curPos, endPos - curPos);

AddFieldValue(mfTitle, TmpStr1); 
AddCustomFieldValueByName('Title', TmpStr1);


//Save start position for Movie data
topPos := PosFrom('<div class="page-heading">', HTML, curPos)


//~mfYear~ or ~Year~

endPos := PosFrom('</span></h1>', HTML, curPos);
curPos := endPos - 5;
TmpStr2 := IntToStr(StrToInt(Copy(HTML, curPos, 4)));

if TmpStr2 = '0' then
TmpStr2 := '';

AddFieldValue(mfYear, TmpStr2);
AddCustomFieldValueByName('Year', TmpStr2);

if TmpStr2 = '' then
TmpStr2 := 'year unknown';

if RICK_CA then
LogMessage('Parsing ' + TmpStr1 + '(' + TmpStr2 + ') using rick.ca script options')
else
LogMessage('Parsing ' + TmpStr1 + '(' + TmpStr2 + ')');

--- End code ---

I'm also curious why you need to save a custom Title. Is that because you use mfTitle for titles translated to you native language?


--- Quote ---With a similar code would also have movie title also recovered in the "Review or Releases".
--- End quote ---

Sorry, I don't understand. Do we need to make further changes? :o

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version