Posted by: Ivek23
« on: January 17, 2013, 11:11:42 am »
Here is solution:
//Get URL
EndPos := Pos('">Overview</a>', HTML);
if EndPos > 0 then begin
curPos := PrevPos('<a href="', HTML, EndPos);
AddFieldValue(mfURL, 'http://web.archive.org'+Copy(HTML, curPos + 9, EndPos - curPos - 9));
end else
AddFieldValue(mfURL, MovieURL);
//Get URL
EndPos := Pos('">Overview</a>', HTML);
if EndPos > 0 then begin
curPos := PrevPos('<a href="', HTML, EndPos);
AddFieldValue(mfURL, 'http://web.archive.org'+Copy(HTML, curPos + 9, EndPos - curPos - 9));
end else
//AddFieldValue(mfURL, MovieURL); // Changed to:
AddCustomFieldValueByName('Urlw', '<link url="' + MovieURL + '">' + MovieURL + '</link>');
AddCustomFieldValueByName('Urlw1', '<link url="' + MovieURL + '">' + MovieURL + '</link>');
//Get Review URL
if GET_REVIEW then begin
EndPos := Pos('">Review</a>', HTML);
if EndPos > 0 then begin
curPos := PrevPos('<a href="', HTML, EndPos);
ExtraLinks[smReview] := 'http://web.archive.org'+Copy(HTML, curPos + 9, EndPos - curPos - 9);
end;
end;
//Get Cast URL
EndPos := Pos('">Cast</a>', HTML);
if EndPos > 0 then begin
curPos := PrevPos('<a href="', HTML, EndPos);
ExtraLinks[smCast] := 'http://web.archive.org'+Copy(HTML, curPos + 9, EndPos - curPos - 9);
end;
//Get Credits URL
if GET_CREDITS then begin
EndPos := Pos('">Production Credits</a>', HTML);
if EndPos > 0 then begin
curPos := PrevPos('<a href="', HTML, EndPos);
ExtraLinks[smCredits] := 'http://web.archive.org'+Copy(HTML, curPos + 9, EndPos - curPos - 9);
end;
end;
//Title
curPos := Pos('<span class="title">', HTML) + Length('<span class="title">');
EndPos := PosFrom('</span>', HTML, curPos);
AddCustomFieldValueByName('Titlew', Copy(HTML, curPos, EndPos - curPos));
//Poster
curPos := PosFrom('<tr><td valign="top"><img src="', HTML, EndPos);
if curPos > 0 then begin
curPos := curPos + Length('<tr><td valign="top"><img src="');
EndPos := PosFrom('"', HTML, curPos);
ExtraLinks[smPoster] := 'http://web.archive.org'+Copy(HTML, curPos, EndPos - curPos);
if Pos('noimage', ExtraLinks[smPoster]) > 0 then
ExtraLinks[smPoster] := '';
end;
I attach the script, which is now corrected.
[attachment deleted by admin]