English > Development

Script for egafd.com

<< < (9/27) > >>

Ivek23:
I found the problem, tmpYear wrong.  I like this set tmpYear : Integer; ,  but not like this tmpYear : String;

Rest tomorrow.

pra15:
I think temYear must be a string. tmpYear is just the two firsts letters of "notes" to know what style of date is writen in the page.
We work in a text for search data. (in the case of 1980s or 1980?  or c.1980),
and the problem already existed before the modification.

We can translate Year in integer before addPersonMovie, but for search value i think we must stay in string.

I think is the develpoment of the script who is en cause.
If there's not "Role" after actual line movie search the function PosFrom find the "Role" of the movie in the next line.
We must make a condition before searching //Get role

I've taken for example to work in script this url : http://www.egafd.com/actresses/details.php/id/n00008
There's many case of date.

pra15:
I found this solution, it's not not very elegant but it's OK


--- Code: ---// Get Role (Not yet defined)
difpos := (PosFrom('<i>', HTML, (actposEnd-1))+4) - actposend;
logmessage('DIFFERENCE : ' + intToStr(difpos));

If difpos < 200 then begin

         actPosStart := PosFrom('<i>', HTML, (actposend-1)) + 4;
         {actPosStart := PosFrom('> <i>', HTML, actPosStart) + 6;}
         actPosEnd:=PosFrom('</i></li>', HTML, actPosStart) - 1;
         Role := Trim(Copy(HTML, actposStart, (actPosEnd - actPosStart)));
         LogMessage('Role: ' + Role);
     
         debug_pos1:=Pos('(',Role);
         if debug_pos1 >0 then
         Role:= Copy(Role,0,debug_pos1-1);
         LogMessage(Role);

end;
--- End code ---

Perhaps it can have exeptions, in this case we must modify the number of difference (here 200).

pra15:
Just a little modification in the case where the last movie in the list has not "role".


--- Code: ---// Get Role (Not yet defined)
difpos := (PosFrom('<i>', HTML, (actposEnd-1))+4) - actposend;
logmessage('DIFFERENCE : ' + intToStr(difpos));

If difpos > 0 then begin
If difpos < 200 then begin

          actPosStart := PosFrom('<i>', HTML, (actposend-1)) + 4;
          actPosEnd:=PosFrom('</i></li>', HTML, actPosStart) - 1;
        Role := Trim(Copy(HTML, actposStart, (actPosEnd - actPosStart)));
          LogMessage('Role: ' + Role);
     
          debug_pos1:=Pos('(',Role);
          if debug_pos1 >0 then
          Role:= Copy(Role,0,debug_pos1-1);
          LogMessage(Role);

end;
end;
--- End code ---

pra15:
As a suggestion up,

I add this :


--- Code: ---//If Original:
actposstart := actposEnd + 5;
actposstart := PosFrom('">', HTML, actposstart) + 2;
actPosEnd := PosFrom('</', HTML, actPosstart) - 1;
If copy(HTML, actposstart, 3) = 'alt' then
OrigT := Copy(HTML, (actPosstart + 22),(actPosEnd-actPosStart-21))
else
OrigT := Title;
--- End code ---


and :


--- Code: ---// Total Line
If Lien <> '' then
Lien := Lien + #13;
If URL1 <> '' then begin
If OrigT <> Title then
Lien := Lien + Name
else
Lien := Lien + '<link url="' + URL1 + '">' + Name + '</link>';
end;
If Year <> '' then
Lien := Lien + ' • ' + Year;
If Note <> '' then
Lien := Lien + ' • ' + Note;
If Role <> '' then
Lien := Lien + ' • ' + Role;

LogMessage('LIEN :' + Lien);
--- End code ---

So in the list of movie in Field Bio, there's only link with original title!
I think it's clearly.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version