Very good job, works great, but miss the release date, because it missing in the transfer of information.
It may help this one piece of code to release date:
procedure ParseMovie(MovieURL : String; HTML : String);
var
curPos, curPos1, endPos : Integer;
Date, Released, Wpage, Wpage1, TmpStr, TmpStr0, TmpStr1, TmpStr2, TmpStr3 : String;
DateParts: TWideArray;
begin
//Date ~Updated~ (choose simple or verbose version)
Date := DateToStr(CurrentDateTime);
if Date <> '' then
begin
ExplodeString(Date, DateParts, '-');
Date := DateParts[2] +'.'+ DateParts[1] +'.'+ DateParts[0];
Date := StringReplace(Date, '01.', '1.', True, True, False);
Date := StringReplace(Date, '02.', '2.', True, True, False);
Date := StringReplace(Date, '03.', '3.', True, True, False);
Date := StringReplace(Date, '04.', '4.', True, True, False);
Date := StringReplace(Date, '05.', '5.', True, True, False);
Date := StringReplace(Date, '06.', '6.', True, True, False);
Date := StringReplace(Date, '07.', '7.', True, True, False);
Date := StringReplace(Date, '08.', '8.', True, True, False);
Date := StringReplace(Date, '09.', '9.', True, True, False);
AddCustomFieldValueByName('TheMovieDB Updated', Date); // Simple
// AddCustomFieldValueByName('TheMovieDB Updated', DateToStr(CurrentDateTime)); // Simple
// AddCustomFieldValueByName('TheMovieDB Updated', DateToStr(CurrentDateTime) + ' at ' + TimeToStr(CurrentDateTime)); // Verbose
// AddCustomFieldValueByName('TheMovieDB Updated', DateToStr(CurrentDateTime) + + ' at ' + TimeToStr(CurrentDateTime) + ' • ' + SCRIPT_NAME + ' ' + SCRIPT_VERSION); // Annoying
//AddCustomFieldValueByName('TheMovieDB Updated1', Date + ' at ' + TimeToStr(CurrentDateTime) + ' • ' + SCRIPT_NAME + ' ' + SCRIPT_VERSION); // Annoying
AddCustomFieldValueByName('TheMovieDB Updated1', Date + ' at ' + TimeToStr(CurrentDateTime) + ' • ' + RATING_NAME + ' ' + SCRIPT_VERSION); // Annoying
end else
LogMessage('date not found');
//~Released~
curPos := PosFrom('"release_date":"', HTML, EndPos);
if curPos > 0 then begin
curPos := PosFrom('"release_date":"', HTML, EndPos);
endPos := PosFrom('","revenue"', HTML, curPos);
Released := TextBetween(HTML, '"release_date":"', '","revenue"', True, curPos);
//Released := StringReplace(Released, '01', '1', True, True, False);
//Released := StringReplace(Released, '02', '2', True, True, False);
//Released := StringReplace(Released, '03', '3', True, True, False);
//Released := StringReplace(Released, '04', '4', True, True, False);
//Released := StringReplace(Released, '05', '5', True, True, False);
//Released := StringReplace(Released, '06', '6', True, True, False);
//Released := StringReplace(Released, '07', '7', True, True, False);
//Released := StringReplace(Released, '08', '8', True, True, False);
//Released := StringReplace(Released, '09', '9', True, True, False);
if Released <> '' then
begin
ExplodeString(Released, DateParts, '-');
Released := DateParts[2] +'.'+ DateParts[1] +'.'+ DateParts[0];
LogMessage('rdate: '+ Released);
AddFieldValueXML('rdate', Released);
AddCustomFieldValueByName('Release info', Released);
end else
LogMessage('rdate not found');
end;
end;