English > Scripts and Templates

Adult.DVDEmpire.com (movies)

(1/4) > >>

nostra:
Current script version [0.1.0.0]

[attachment deleted by admin]

efrasiyab:
Thanks :)

AimHere:
Hi,

I've noticed lately that this script no longer properly imports the Production Year for titles from the website. It appears that Adult DVD Empire modified the text preceding the year value on their website, which the parser in the script depends on to locate the year. Fortunately, the script is easy enough to fix. Just locate the "adultdvdempire.psf" file (in the Scripts subfolder of the main Personal Video Database program folder), open it with a text editor, and search for all occurances of the string "Production Year" and replace them with just "Year".

For reference, the affected sections of code are as follows:
(Starting around line 204)
--------------------------------------------------------
//Year
 AddFieldValue(mfYear, Trim(TextBetween(HTML, '/ Production Year:', '</span>', False, curPos)));  <--- change this
 if curPos < 1 then
  curPos := EndPos; 
--------------------------------------------------------
and (within procedure ParseSearchResults, around line 347)
--------------------------------------------------------
 
  curPos := PosFrom(' Production Year: ', HTML, EndPos);    <---change this
  if curPos > 0 then begin 
   curPos := curPos + Length(' Production Year: ');             <---change this
   EndPos := PosFrom('</span>', HTML, curPos);
 
   Year := Trim(Copy(HTML, curPos, EndPos - curPos));
  end;
--------------------------------------------------------

Hope this helps.
Aimhere

rick.ca:
 
--- Quote ---Hope this helps.
--- End quote ---

It does, especially as an illustration of how easy it is to modify and maintain script.

Users should feel free to post modified/updated scripts—that's why the scripting feature was added. My suggestion as to how to do this is to add something like this...

//Script data
//Fixed: "Production Year" changed to "Year" - AimHere 01/15/2009
SCRIPT_VERSION = '0.1.0.1';

...to document the change (in addition to appropriate comments in the body of the script). The script could be named "adultdvdempire 0.1.0.1.psf" and attached to a post that more fully explains the changes. If the changes were more significant and constituted a new "branch" (i.e., users would have a choice of using the new version, or sticking with the old), the version number would be "0.1.1.0".

No one should be concerned about scripts they post being bug-free or appropriate for all other users. Others can correct or modify the script and post their own version. It would be appropriate, for example, to post a script will a message that says something like, "This is my latest attempt to make this work. I'm still having trouble with..."

nostra:
Golden words, rick.


--- Quote ---//Script data
//Fixed: "Production Year" changed to "Year" - AimHere 01/15/2009
SCRIPT_VERSION = '0.1.0.1';
--- End quote ---

This is especially a good advice.

Navigation

[0] Message Index

[#] Next page

Go to full version