IMDB - Goofs
Posted: 2015-05-12 16:44:04
Is there any chance to add 'GOOFS' in the comment box, after Trivia? ![confused :??:](./images/smilies/confused.gif)
![confused :??:](./images/smilies/confused.gif)
Code: Select all
// Goofs
if GetOption('Trivia') > 0 then
begin
sleep(50);
Value := MovieUrl;
FullValue := ConvertToASCII(GetPage(Value+'/goofs'));
case GetOption('Trivia') of
1,2:
Value := TextBetween(FullValue, '<div class="sodatext">', '</div>');
3,4:
Value := TextBetween(FullValue, '<div class="list">', '<div class="article" id="see_also">');
end;
if Value <> '' then
begin
Value := StringReplace(Value, #13#10, '');
while Pos(' ', Value) > 0 do
Value := StringReplace(Value, ' ', '');
while Pos('<span class="linksoda">', Value) > 0 do
begin
Value := StringReplace(Value, TextBetween(Value, '<span class="linksoda">', '</div>'), '');
Value := StringReplace(Value, '<span class="linksoda"></div>', '');
end;
Value := StringReplace(Value, 'See also Trivia', '');
Value := StringReplace(Value, '<div class="sodatext">', #13#10 + '- ');
Value := StringReplace(Value, '<h4 class="li_group">', #13#10);
Value := StringReplace(Value, TextBetween(Value, '<div class="did-you-know-actions">', '</div>'), '');
HTMLRemoveTags(Value);
HTMLDecode(Value);
Value := RegExprSetReplace('\s[\d,]+\s+of\s+[\d,]+\sfound\sthis\sinterestingInteresting\?YesNo\|', Value, '', false);
Value := RegExprSetReplace('\s*Is\sthis\sinteresting\?Interesting\?YesNo\|', Value, '', false);
Value := RegExprSetReplace('Spoilers\sThe\strivia\sitems?\sbelow\smay\sgive\saway\simportant\splot\spoints\.\s*', Value, #13#10 + 'Spoilers:' + #13#10, false);
Value := RegExprSetReplace('\s*See\salsoGoofs.*', Value, '', false);
if (GetOption('Trivia') = 1) or (GetOption('Trivia') = 2) then
Value := ' ' + Value;
case GetOption('Trivia') of
1,3:
begin
if GetField(fieldDescription) <> '' then
Value := GetField(fieldDescription) + #13#10 + #13#10 + 'IMDB GOOFS:' + Trim(Value)
else
Value := 'IMDB GOOFS: ' + Value;
SetField(fieldDescription, Value);
end;
2,4:
begin
if GetField(fieldComments) <> '' then
Value := GetField(fieldComments) + #13#10 + #13#10 + 'IMDB GOOFS:' + Trim(Value)
else
Value := 'IMDB GOOFS: ' + Value;
SetField(fieldComments, Value);
end;
end;
end;
end;