English > Support

AllRovi movie script

<< < (8/10) > >>

rick.ca:
I don't think moving routines around is the solution. I'm still not sure my solution works in all situations, but it seems to me the problem occurs when 'curPos' gets past the point in the page where the data exists (in this case, Characteristics). This can happen when the order of the data elements on the page change. Generally, the order does not change, but it can when all the usual data elements do not exist. So my solution is simply to reset 'curPos' to 'topPos' (introduced in an earlier version to solve the same issue for Rating and Genre). It seems to work for all the "problem" titles mentioned lately, and I haven't seen it break anything else. But...


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

...may not hold for those rare cases where what's normally a child page/tab doubles as the main page. Maybe I already have, but I'll test that once I recall an example of where we found that issue before. [Edit:] It seems I've already tested this, using Top Model and The Dallas Connection—cases where 'Cast and Crew' serves as the main page. So I think the only concern would be variations on that theme we have not yet encountered. :-\

Also, there are two issues involved with titles like Lustful Addiction. First, the AllRovi search does not find the movie. The page can only be accessed by entering the URL. (See Adult titles are there, but not discoverable?) If the PVD record has the correct URL, the script should work fine. That is, Characteristics should now be retrieved.

All this from one of my few remaining brain cells. Please torture-test the attached. ;)

[attachment deleted by admin]

RazorHall:
AllRovi 1.3 Candidate works perfectly on every title I've tried so far.  I'll let you know if any other weird cases should appear.  And thanks!  You guys are doing a terrific job.   :D

rick.ca:
Thanks. But let's not get too excited. Most of my test titles came from you. Who knows what we'll hear from, say, the art film crowd... ;)

Ivek23:
This movies
Stargate Universe [TV Series] (2009)
Stargate Atlantis [TV Series] (2004)
Stargate Infinity [Animated TV Series] (2002)
have something in common in the Cast & Crew tab, there is only the Crew section, but is not there Cast section, so AllRovi script did not pass the info data with Section Crew.

So I ParseCast adding pieces of code

--- Code: ---//~Cast~ or ~ctActors~
//save entire Cast tab to custom memo field, as well as individual actors.

procedure ParseCast(HTML : String);
var
curPos, endPos : Integer;
TmpStr : String;
Name, Role, URL : String;
begin
curPos := Pos('<div class="tabset-content main-tab-pane">', HTML);
if curPos < 1 then

curPos := Pos('<div class="description-box">', HTML);
if curPos < 1 then
Exit;
 
TmpStr := '';
 ...

 ...
AddCustomFieldValueByName('Cast', TmpStr);


//~Crew~
curPos := Pos('<div class="profession-box">', HTML);
if curPos < 1 then
Exit;

TmpStr := '';
 ...

 ...
end;

AddCustomFieldValueByName('Crew', TmpStr);

end;


//~Releases~


--- End code ---

and now pass the info data with Section Crew,
(edit:) or if the Cast section and Crew section both there.

EDIT
AllRovi 1.3 candidate 1 attached.

[attachment deleted by admin]

rick.ca:

--- Quote ---AllRovi 1.3 candidate 1 attached.
--- End quote ---

I haven't tested it yet, but I'm curious about this...


--- Code: ---//~Crew~curPos := Pos('<div class="profession-box">', HTML);
if curPos < 1 then
Exit;
--- End code ---

Did you intend to disable the setting of curPos, or did you accidentally delete the line feed?

[Edit:] You must have—it doesn't work with this line active. I've removed it.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version