English > Development
Script for egafd.com
Ivek23:
egafd_movie
Small change for Year:
I have found and corrected a small error in the Year code.
--- Code: ---///// Part <Details> :
If Pos('<th>Details</th>', HTML) > 0 then begin
//Year
dbgstrg := '';
CurPos := Pos('<td valign="top">Released: ', HTML);
endpos := CurPos;
LogMessage('getting year');
dbgstrg := TextBetween(HTML, '<td valign="top">Released: </td><td width="100%" class="notes">', '</td>', False, CurPos);
LogMessage('YEAR:' + dbgstrg);
debug_pos1:=Pos('?',dbgstrg);
if debug_pos1 >0 then
dbgstrg := Copy(dbgstrg,0,debug_pos1-1);
LogMessage(dbgstrg);
debug_pos1:=Pos('s',dbgstrg);
if debug_pos1 >0 then
dbgstrg := Copy(dbgstrg,0,debug_pos1-1);
LogMessage(dbgstrg);
If dbgstrg <> '' then
AddFieldValue(mfYear,dbgstrg);
//Director
--- End code ---
Ivek23:
egafd_movie
Small change for Notes:
For security reasons, I fixed a piece of code in the Notes code.
--- Code: --- //Notes
//pull ~Notes~ from Part 'Details'
dbgstrg := '';
curpos := Pos('<td valign="top">Notes: ' , HTML);
EndPos := curPos;
LogMessage('Notes')
dbgstrg := TextBetween(HTML, '<td valign="top">Notes: </td><td width="100%" class="notes">', '</td>', False, CurPos);
LogMessage('Notes :' + dbgstrg);
If dbgstrg <> '' then
{AddFieldValue(mfDescription, dbgstrg);}
AddFieldValueXML('tagline', dbgstrg);
end; //// End of Part <Details>
--- End code ---
Ivek23:
egafd_movie
Complete Details Code:
--- Code: --- ///// Part <Details> :
If Pos('<th>Details</th>', HTML) > 0 then begin
//Year
//pull ~Year~ from Part 'Details'
dbgstrg := '';
CurPos := Pos('<td valign="top">Released: ', HTML);
endpos := CurPos;
LogMessage('getting year');
dbgstrg := TextBetween(HTML, '<td valign="top">Released: </td><td width="100%" class="notes">', '</td>', False, CurPos);
LogMessage('YEAR:' + dbgstrg);
debug_pos1:=Pos('?',dbgstrg);
if debug_pos1 >0 then
dbgstrg := Copy(dbgstrg,0,debug_pos1-1);
LogMessage(dbgstrg);
debug_pos1:=Pos('s',dbgstrg);
if debug_pos1 >0 then
dbgstrg := Copy(dbgstrg,0,debug_pos1-1);
LogMessage(dbgstrg);
If dbgstrg <> '' then
AddFieldValue(mfYear,dbgstrg);
//Director
//pull ~Director~ from Part 'Details'
dbgstrg := '';
curPos := Pos('<td valign="top">Director: ', HTML);
EndPos := curPos;
LogMessage('getting Director');
dbgstrg:= TextBetween(HTML, '<td valign="top">Director: </td><td width="100%" class="notes">', '</td>', False, CurPos);
LogMessage('DIRECTOR:' + dbgstrg);
If dbgstrg <> '' then
AddFieldValueXML('comment', ' • • ' + SCRIPT_NAME + ' ' + SCRIPT_VERSION +
' • • ' + 'Directors: ' + dbgstrg)
else
AddFieldValueXML('comment', ' • • ' + SCRIPT_NAME + ' ' + SCRIPT_VERSION +
' • • ');
debug_pos1:=Pos('(',dbgstrg);
if debug_pos1 >0 then
dbgstrg := Copy(dbgstrg,0,debug_pos1-1);
LogMessage(dbgstrg);
debug_pos1:=Pos(', ',dbgstrg);
if debug_pos1 >0 then
dbgstrg := Copy(dbgstrg,0,debug_pos1-1);
LogMessage(dbgstrg);
debug_pos1:=Pos(' as ',dbgstrg);
if debug_pos1 >0 then
dbgstrg := Copy(dbgstrg,0,debug_pos1-1);
LogMessage(dbgstrg);
debug_pos1:=Pos(' aas ',dbgstrg);
if debug_pos1 >0 then
dbgstrg := Copy(dbgstrg,0,debug_pos1-1);
LogMessage(dbgstrg);
debug_pos1:=Pos('/',dbgstrg);
if debug_pos1 >0 then
dbgstrg := Copy(dbgstrg,0,debug_pos1-1);
LogMessage(dbgstrg);
debug_pos1:=Pos(' and ',dbgstrg);
if debug_pos1 >0 then
dbgstrg := Copy(dbgstrg,0,debug_pos1-1);
LogMessage(dbgstrg);
debug_pos1:=Pos('?',dbgstrg);
if debug_pos1 >0 then
dbgstrg := Copy(dbgstrg,0,debug_pos1-1);
LogMessage(dbgstrg);
debug_pos1:=Pos('or ',dbgstrg);
if debug_pos1 >0 then
dbgstrg := Copy(dbgstrg,0,debug_pos1-1);
LogMessage(dbgstrg);
If dbgstrg <> '' then
AddMoviePerson(dbgstrg, '', '', '', ctDirectors);
//Notes
//pull ~Notes~ from Part 'Details'
dbgstrg := '';
curpos := Pos('<td valign="top">Notes: ' , HTML);
EndPos := curPos;
LogMessage('Notes')
dbgstrg := TextBetween(HTML, '<td valign="top">Notes: </td><td width="100%" class="notes">', '</td>', False, CurPos);
LogMessage('Notes :' + dbgstrg);
If dbgstrg <> '' then
{AddFieldValue(mfDescription, dbgstrg);}
AddFieldValueXML('tagline', dbgstrg);
end; //// End of Part <Details>
--- End code ---
Ivek23:
egafd_movie
Added previously mentioned changes.
egafd_mod13 script attached
[attachment deleted by admin]
Ivek23:
egafd_movie
Small change for Notes:
Added Duration.
--- Code: --- //Notes
//pull ~Notes~ from Part 'Details'
dbgstrg := '';
curpos := Pos('<td valign="top">Notes: ' , HTML);
EndPos := curPos;
LogMessage('Notes')
dbgstrg := TextBetween(HTML, '<td valign="top">Notes: </td><td width="100%" class="notes">', '</td>', False, CurPos);
LogMessage('Notes :' + dbgstrg);
If dbgstrg <> '' then
{AddFieldValue(mfDescription, dbgstrg);}
AddFieldValueXML('tagline', dbgstrg);
//pull ~Duration~ from 'Details'
//Duration
curpos := Pos('<td valign="top">Notes: ' , HTML);
LogMessage('getting durations')
actPosEnd := PosFrom(' mins', HTML, actPosStart);
actPosStart := actPosEnd - 3;
Tmp := IntToStr(StrToInt(Copy(HTML, actPosStart, 3)));
LogMessage('Duration: ' + Tmp);
if Tmp = '0' then Tmp := '';
If Tmp <> '' then AddFieldValue(mfDuration, Tmp);
if Tmp = '' then Tmp := 'duration unknown';
LogMessage(' Parsing: ' + Tmp);
end; //// End of Part <Details>
--- End code ---
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version