English > Scripts and Templates
Script: FilmAffinity [ES] (Easy Script)
Ivek23:
--- Quote from: VVV_Easy_Programing on May 22, 2016, 04:55:44 pm ---Thank very much, Ivek23 for maintaining the program ;D.
--- End quote ---
You are Welcome and thank you.
--- Quote from: VVV_Easy_Programing on May 22, 2016, 04:55:44 pm ---Attached the new version.
--- End quote ---
Thank you for the new version.
jippo:
I have a problem.
Am-rA:
Ivek thank people like you is what makes it good that Internet is to remain standing :D
Ivek23:
--- Quote from: Am-rA on May 29, 2016, 10:48:30 am ---
Ivek thank people like you is what makes it good that Internet is to remain standing :D
--- End quote ---
Thanks, Am-rA
Ivek23:
--- Quote from: jippo on May 27, 2016, 08:51:05 pm ---I have a problem.
--- End quote ---
The solution to this problem is decorated.
I fixed this problem:
This is added to the code:
--- Code: --- ItemList:=StringReplace(ItemList,'<div class="credits">','',True,True,False); //WEB_SPECIFIC
ItemList:=StringReplace(ItemList,'<span>','',True,True,False); //WEB_SPECIFIC
ItemList:=StringReplace(ItemList,'</span>','',True,True,False); //WEB_SPECIFIC
ItemList:=StringReplace(ItemList,'</div>','',True,True,False); //WEB_SPECIFIC
--- End code ---
Corrected code is such now:
--- Code: --- //Get ~Writers~ (Only name in Web from !name! list).
curPos:=Pos('<dt>Guión</dt>',HTML); //WEB_SPECIFIC
if 0<curPos then begin
curPos:=curPos+Length('<dt>Guión</dt>'); //WEB_SPECIFIC
curPos:=PosFrom('<dd>',HTML,curPos)+Length('<dd>'); //WEB_SPECIFIC
endPos:=PosFrom('</dd>',HTML,curPos); //WEB_SPECIFIC
ItemList:=Copy(HTML,curPos,endPos-curPos);
ItemList:=StringReplace(ItemList,'<div class="credits">','',True,True,False); //WEB_SPECIFIC
ItemList:=StringReplace(ItemList,'<span>','',True,True,False); //WEB_SPECIFIC
ItemList:=StringReplace(ItemList,'</span>','',True,True,False); //WEB_SPECIFIC
ItemList:=StringReplace(ItemList,'</div>','',True,True,False); //WEB_SPECIFIC
LogMessage(' Parse results List Writers:'+ItemList+'||');
curPos:=1; //WEB_SPECIFIC
endPos:=PosFrom(', ',ItemList,curPos); //WEB_SPECIFIC
if 0=endPos then ItemValue:=Copy(ItemList,curPos,1+Length(ItemList)-curPos);
While 0<endPos do begin
ItemValue:=Copy(ItemList,curPos,endPos-curPos);
AddMoviePerson(ItemValue,'','','',ctWriters);
LogMessage(' Get results Writers:'+ItemValue+'||');
curPos:=endPos+Length(', '); //WEB_SPECIFIC
endPos:=PosFrom(', ',ItemList,curPos); //WEB_SPECIFIC
if 0=endPos then ItemValue:=Copy(ItemList,curPos,1+Length(ItemList)-curPos);
end;
AddMoviePerson(ItemValue,'','','',ctWriters);
LogMessage(' Get results Writers:'+ItemValue+'||');
end;
//Get ~Composers~ (Only name in Web from !name! list).
curPos:=Pos('<dt>Música</dt>',HTML); //WEB_SPECIFIC
if 0<curPos then begin
curPos:=curPos+Length('<dt>Música</dt>'); //WEB_SPECIFIC
curPos:=PosFrom('<dd>',HTML,curPos)+Length('<dd>'); //WEB_SPECIFIC
endPos:=PosFrom('</dd>',HTML,curPos); //WEB_SPECIFIC
ItemList:=Copy(HTML,curPos,endPos-curPos);
ItemList:=StringReplace(ItemList,'<div class="credits"><span>','',True,True,False); //WEB_SPECIFIC
ItemList:=StringReplace(ItemList,'</span></div>','',True,True,False); //WEB_SPECIFIC
LogMessage(' Parse results List Composers:'+ItemList+'||');
curPos:=1; //WEB_SPECIFIC
endPos:=PosFrom(', ',ItemList,curPos); //WEB_SPECIFIC
if 0=endPos then ItemValue:=Copy(ItemList,curPos,1+Length(ItemList)-curPos);
While 0<endPos do begin
ItemValue:=Copy(ItemList,curPos,endPos-curPos);
AddMoviePerson(ItemValue,'','','',ctComposers);
LogMessage(' Get results Composers:'+ItemValue+'||');
curPos:=endPos+Length(', '); //WEB_SPECIFIC
endPos:=PosFrom(', ',ItemList,curPos); //WEB_SPECIFIC
if 0=endPos then ItemValue:=Copy(ItemList,curPos,1+Length(ItemList)-curPos);
end;
AddMoviePerson(ItemValue,'','','',ctComposers);
LogMessage(' Get results Composers:'+ItemValue+'||');
end;
.
.
.
//Get ~studio~ (several values in a comma separated list)
curPos:=Pos('<dt>Productora</dt>',HTML); //WEB_SPECIFIC
if 0<curPos then begin
curPos:=curPos+Length('<dt>Productora</dt>'); //WEB_SPECIFIC
curPos:=PosFrom('<dd>',HTML,curPos)+Length('<dd>'); //WEB_SPECIFIC
endPos:=PosFrom('</dd>',HTML,curPos); //WEB_SPECIFIC
ItemList:=Copy(HTML,curPos,endPos-curPos);
ItemList:=StringReplace(ItemList,';',',',True,True,False); //WEB_SPECIFIC. For Conuntry coproductions.
ItemList:=StringReplace(ItemList,' /',',',True,True,False); //WEB_SPECIFIC
ItemList:=StringReplace(ItemList,'<div class="credits"><span>','',True,True,False); //WEB_SPECIFIC
ItemList:=StringReplace(ItemList,'</span></div>','',True,True,False); //WEB_SPECIFIC
AddFieldValueXML('studio',ItemList);
LogMessage(' Get results studio:'+ItemList+'||');
end;
--- End code ---
As well as the situation in the version of the script, and otherwise it is wrong
--- Code: ---//Script data
SCRIPT_VERSION = '0.2.1.3';
--- End code ---
and this is correct
--- Code: ---//Script data
SCRIPT_VERSION = '0.2.1.4';
--- End code ---
I fixed the Description code because the script writer did not follow my correction in the previous version of the script.
--- Quote from: Ivek23 on May 16, 2016, 07:01:05 am ---
--- Quote from: Ivek23 on May 13, 2016, 04:41:30 pm ---
--- Quote from: jippo on May 12, 2016, 09:18:58 pm ---Description doesn't work fine if it is empty.
--- End quote ---
Yes, I am aware of this problem, unfortunately, it is currently I can not fix.
--- End quote ---
Yeah, now I managed to fix it. Now it should work properly.
Check the attached script.
--- End quote ---
Old code
--- Code: --- //Get ~description~
curPos:=Pos('<dt>Sinopsis</dt>',HTML)+Length('<dt>Sinopsis</dt>'); //WEB_SPECIFIC
curPos:=PosFrom('<dd itemprop="description">',HTML,curPos)+Length('<dd itemprop="description">'); //WEB_SPECIFIC
endPos:=PosFrom('</dd>',HTML,curPos); //WEB_SPECIFIC
ItemValue:=Copy(HTML,curPos,endPos-curPos);
ItemValue:=StringReplace(ItemValue,'(FILMAFFINITY)','',True,True,False); //WEB_SPECIFIC
ItemValue:=RemoveTags(ItemValue,False);
AddFieldValueXML('description',ItemValue);
LogMessage(' Get result description:'+ItemValue+'||');
--- End code ---
New code
--- Code: --- //Get ~description~
curPos:=Pos('<dt>Sinopsis</dt>',HTML); //WEB_SPECIFIC
if 0<curPos then begin
curPos:=curPos+Length('<dt>Sinopsis</dt>'); //WEB_SPECIFIC
curPos:=PosFrom('<dd itemprop="description">',HTML,curPos)+Length('<dd itemprop="description">'); //WEB_SPECIFIC
endPos:=PosFrom('</dl>',HTML,curPos); //WEB_SPECIFIC
ItemValue:=Copy(HTML,curPos,endPos-curPos);
ItemValue:=StringReplace(ItemValue,'(FILMAFFINITY)','',True,True,False); //WEB_SPECIFIC
ItemValue:=RemoveTags(ItemValue,False);
AddFieldValueXML('description',ItemValue);
LogMessage(' Get result description:'+ItemValue+'||');
end;
--- End code ---
Check the attached script.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version