English > Scripts and Templates
Project Allocine script
Ivek23:
Great, it works ok, but something is missing or some details
--- Code: --- Details := AddDetails(HTML,'Langue','<div>Langue</div></th><td>',Details);
Details := AddDetails(HTML,'Date de sortie VOD','<div>Date de sortie VOD</div></th><td>',Details);
Details := AddDetails(HTML,'Date de sortie DVD','<div>Date de sortie DVD</div></th><td>',Details);
Details := AddDetails(HTML,'Date de sortie Blu-ray','<div>Date de sortie Blu-ray</div></th><td>',Details);
--- End code ---
that are added in this code:
--- Code: ---//Partie Synopsis et details :
CurPos := Pos('Synopsis et d', HTML);
AddCustomFieldValueByName('Controle parental', TextBetween(HTML,'<span class="insist">','</span>',True,CurPos));
AddFieldValue(13,TextBetween(HTML,'"description">','</p>',True,CurPos));
If Pos('Titre original</div></th><td>',HTML) > 0 then AddFieldValueXML('origtitle',TextBetween(HTML,'Titre original</div></th><td>','</td>',True,CurPos));
CurPos := Pos('e de production',HTML);
If CurPos > 0 then AddFieldValueXML('year',TextBetween(HTML,'">','</span>',True,CurPos));
Details := AddDetails(HTML,'Distributeur','visible"><th><div>Distributeur</div></th><td>',Details);
Details := AddDetails(HTML,'Budget','<div>Budget</div></th><td>',Details);
Details := AddDetails(HTML,'Format de production','Format de production</div></th><td>',Details);
Details := AddDetails(HTML,'Format de projection','Format de projection</div></th><td>',Details);
Details := AddDetails(HTML,'Couleur','Couleur</div></th><td>',Details);
Details := AddDetails(HTML,'Format audio','Format audio</div></th><td>',Details);
Details := AddDetails(HTML,'Type de film','Type de film</div></th><td>',Details);
Details := AddDetails(HTML,'N° de visa','N° de Visa</div></th><td>',Details);
Details := AddDetails(HTML,'Box office France','Box Office France</div></th><td>',Details);
Details := AddDetails(HTML,'Langue','<div>Langue</div></th><td>',Details);
Details := AddDetails(HTML,'Date de sortie VOD','<div>Date de sortie VOD</div></th><td>',Details);
Details := AddDetails(HTML,'Date de sortie DVD','<div>Date de sortie DVD</div></th><td>',Details);
Details := AddDetails(HTML,'Date de sortie Blu-ray','<div>Date de sortie Blu-ray</div></th><td>',Details);
AddCustomFieldValueByName('Details',Details);
END;
--- End code ---
I made a small cosmetic correction in this code:
before the cosmetic correction
--- Code: ---Function AddDetails(HTML, Name, where, strdetail : string):string;
Var
CurPos : Integer;
Begin
CurPos := Pos(where,HTML);
If Copy(HTML,CurPos+Length(where),3) <> ' - ' then begin
Result := strdetail + Name + ' : ' + TextBetween(HTML,'<td>','</td>',true,CurPos) + #13#10;
end else
Result := strdetail;
end;
--- End code ---
after the cosmetic correction
--- Code: ---Function AddDetails(HTML, Name, where, strdetail : string):string;
Var
CurPos : Integer;
Begin
CurPos := Pos(where,HTML);
If Copy(HTML,CurPos+Length(where),3) <> ' - ' then begin
Result := strdetail + Name + ' : ' + TextBetween(HTML,'<td>','</td>',true,CurPos) + #13#10;
end else
Result := strdetail;
end;
--- End code ---
He is a better overview of data transferred in the 'Details' custom field.
I also made a small cosmetic correction in this code:
--- Code: --- //Date de sortie :
TestPos := IfNextStep('<span class="lighten">','Date de sortie',HTML,CurPos);
If TestPos <> CurPos then begin
CurPos := TestPos;
.
.
.
end;
//LogMessage('Date de sortie: ' + DteSortie);
//LogMessage('Duree :' + Duree);
AddCustomFieldValueByName('Date de sortie',DteSortie);
Duree := StringReplace(Duree,'h','h ',True,True,True);
AddCustomFieldValueByName('Duree',Duree);
end;
--- End code ---
--- Quote from: pra15 on February 27, 2015, 12:21:02 am ---I don't konw how put the script in download page.
--- End quote ---
Will arrive explanation of PM until Sunday, sorry, I am currently a little tight at the time.
pra15:
Ok Thanks for add the other details, i thinked they have not interest but it's easy to desactive if we don't want them.
The cosmetic it's better with this space.
Ivek23:
--- Quote from: pra15 on February 27, 2015, 10:25:32 pm ---Ok Thanks for add the other details, i thinked they have not interest but it's easy to desactive if we don't want them.
The cosmetic it's better with this space.
--- End quote ---
Thank you for great job.
Ivek23:
Very small bug, Very big problem to download page.
Wrong
--- Code: --- SCRIPT_TYPE = 0; //Movies
--- End code ---
Properly
--- Code: ---SCRIPT_TYPE = stMovies;
--- End code ---
korbenPL:
'this archive is not a vald zip archive'
it's the message I get trying to update PVD
/v1.0.2.3
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version