Posted: 2009-02-24 07:26:39
Nice job.
Just a little note: You added the "platform" comment where "translated title" was correct before . It should be:
Next step is import of publisher(s). For that copy the developer block and modify it for publisher. Just take care that it is placed right behind developer import.
Note: There are two differences between developer and publisher block.
1. The first part of the textbetween function may not start with a '>' here. You can see that if you run the script in editor mode, set breakpoints, and watch variable 'line'. Line will contain
So this time publisher has to be between Uitgegeven door and <br />.
2. When there are more than 1 publishers, import looks like Dreamcatcher en Octagon. We should replace the en with a comma. For that insert a line
to the code block and place it right before you save Value to fieldPublisher. You could place this line to developers block, too, just in case there is more than one studio named for some games.
Now delete the actors block, as it's useless for games. As you will see, the description block should work now correctly, too (it did before for safecrackers, but not e.g. for transformers, that's why you always should test with a couple of games).
I'll explain fixing the users comments import later today. Maybe you find time to have a look on some more games on their website to see if we missed any additional details imports. Sometimes there are more information, that are not available for all games.
Just a little note: You added the "platform" comment where "translated title" was correct before . It should be:
Code: Select all
// translated title
Line := TextBetween(PageText, 'Alternatieve titel', ' </p>');
if Line <> '' then
begin
Line := TextAfter(Line, ': ');
if Line <> '' then
begin
HTMLDecode(Line);
SetField(fieldTranslatedTitle, Line);
end;
end;
// platform
Value := TextBetween(PageText, '<div id="game_info"', '<br />');
Line := RemainingText;
Value := TextAfter(Value, '>');
setField(fieldPlatform, Value);
Note: There are two differences between developer and publisher block.
1. The first part of the textbetween function may not start with a '>' here. You can see that if you run the script in editor mode, set breakpoints, and watch variable 'line'. Line will contain
Code: Select all
Uitgegeven door <a href="http://www.gamesmeter.nl/publisher/Dreamcatcher">Dreamcatcher</a> en <a href="http://www.gamesmeter.nl/publisher/Octagon">Octagon</a><br /><br />Het spel draait volledig om het kraken van verschillende soorten kluizen.....
2. When there are more than 1 publishers, import looks like Dreamcatcher en Octagon. We should replace the en with a comma. For that insert a line
Code: Select all
Value := StringReplace(Value, ' en ', ', ');
Now delete the actors block, as it's useless for games. As you will see, the description block should work now correctly, too (it did before for safecrackers, but not e.g. for transformers, that's why you always should test with a couple of games).
I'll explain fixing the users comments import later today. Maybe you find time to have a look on some more games on their website to see if we missed any additional details imports. Sometimes there are more information, that are not available for all games.