Change moviemeter to gamesmeter script

New scripts, templates and translation files that allows to use Ant Movie Catalog to manage other things than movies
bad4u
Posts: 1148
Joined: 2006-12-11 22:54:46

Post by bad4u »

Nice job.
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); 
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

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.....
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

Code: Select all

Value := StringReplace(Value, ' en ', ', ');
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.
pele
Posts: 72
Joined: 2009-02-21 20:25:57

Post by pele »

Hi,

Thanks, i'm on my work now and it is not possible to run the program/script because firewall issues.

Late tonight i will give it a try.

Grtz, Bianca
pele
Posts: 72
Joined: 2009-02-21 20:25:57

Post by pele »

oke i fixed platform/translated title and add the publisher block. I goes well exept at the game Transformers: The Game (2007). the value is different and i try to fix it but unfortunally i don't manage it.
There are to many platforms......!!!

So wil you look into it?

And don't need the user comments but maby for the officiel script it's right to have it.

I save also that we can import localplayers = singel player /multi player

I here from you.
bad4u
Posts: 1148
Joined: 2006-12-11 22:54:46

Post by bad4u »

Yeah, I see. That's why you need to test a couple of games - if you don't find such game, you cannot see that problem.

The problem is that gamesmeter does not differ between platforms for a game, it just lists available ones, while SGC's platform field is meant to show only one platform for a game - the one you own it for.

In this case I'd recommend just listing available platforms in comments field (e.g. "Available platforms: PC / Macintosh / PS3"). Same for the single player / multi player. This should be quite easy and user comments could be imported behind these or - maybe better - to fieldReviews.

Another option would be to let the script show an extra window on that you have to choose your own platform for the game and then save this to fieldPlatform. But most users don't like scripts that need extra input, especially if you run it for a couple of games. This solution would need some more code.

So what do you prefer ?
pele
Posts: 72
Joined: 2009-02-21 20:25:57

Post by pele »

So i prefer a extra window, i think it looks better because all the right fields are filled then.

But that depends on how mutch time you have to help.
bad4u
Posts: 1148
Joined: 2006-12-11 22:54:46

Post by bad4u »

No problem about the time, it just depends on how urgently you need the script ;)

Well, so we have to change platform retrieving.

Code: Select all

  // platform
  Value := TextBetween(PageText, '<div id="game_info"', '<br />');
  Line := RemainingText;
  Value := TextAfter(Value, '>');
  setField(fieldPlatform, Value); 
First we need to check for extended platforms list like you found on Transformers: The Game and import the full list if available. To do this we check for 'meer..' within the platforms; if it is found on the list we will import full list. This is done with an 'if .. then' condition (if 'meer...' is in Value, then...):

Code: Select all

if Pos('>meer..', Value) > 0 then
    begin
      Value := TextBetween(PageText, 'id="platforms_all">', '</span>');
      Line := RemainingText;
    end;
Add this code to platform import right before you save Value to fieldPlatform.

Now full list of platforms will be imported. But it still is too large for field platform on SGC, so we will split this list and show on a PickList to choose from.

As I have no more time now, I'll explain this later. If you should find time for it, you could paste your latest script once more, so that I can be sure I have the same code base. There should be neccessary only few more changes and cleaning up some code, won't take much longer anymore.
pele
Posts: 72
Joined: 2009-02-21 20:25:57

Post by pele »

I change the script and tested with the game transformers and it works.

So here is the latest code:

Code: Select all

program GamesMeter;

uses
  StringUtils1;

var
  GameName: string;

procedure AnalyzeGamePage(Address: string);
var
  PageText, Line, Value: string;
begin
  PageText := GetPage(Address);

  // URL
  SetField(fieldURL, Address);

  // title & year
  Line := TextBetween(PageText, '<h1>', '</h1>');
  Value := TextBetween(Line, '(', ')');
  SetField(fieldYear, Value);
  Value := Trim(TextBefore(Line, '(', ''));
  HTMLDecode(Value);
  SetField(fieldOriginalTitle, Value);

  // 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, '>');
  if Pos('>meer..', Value) > 0 then
    begin
      Value := TextBetween(PageText, 'id="platforms_all">', '</span>');
      Line := RemainingText;
    end;
  setField(fieldPlatform, Value);

  // Category
  Value := TextBefore(Line, '<br />', '');
  Line := RemainingText;
  HTMLDecode(Value);
  SetField(fieldCategory, Value);

  // Developer
  Value := TextBetween(line, '>Ontwikkeld door ', '<br />');
  Line := RemainingText;
  HTMLRemoveTags(Value);
  HTMLDecode(Value);
  Value := StringReplace(Value, ' en ', ', ');
  SetField(fieldDeveloper, Value);
  
  // publisher
  Value := TextBetween(line, 'Uitgegeven door ', '<br />');
  Line := RemainingText;
  HTMLRemoveTags(Value);
  HTMLDecode(Value);
  Value := StringReplace(Value, ' en ', ', ');
  SetField(fieldPublisher, Value);

  // Description
  Value := TextBetween(Line, '<br />', '</div>');
  HTMLRemoveTags(Value);
  HTMLDecode(Value);
  SetField(fieldDescription, Value);

  // Picture
  Value := TextBetween(PageText, '<img class="poster" src="', '" ');
  if Value <> '' then
  begin
    GetPicture(Value);
  end;

  // Rating
  Value := TextBetween(PageText, '</span>gemiddelde <b>', '<');
  Value := StringReplace(FloatToStr(StrToFloat(StringReplace(Value, ',', '.')) * 2), ',', '.');
  SetField(fieldRating, Value);

  // Comments
  if GetOption('ImportComments') = 1 then
  begin
    Value := TextBetween(PageText, '<div class="forum_message_user">', '<div class="to_page entitypages" id="pages_bottom"></div>');
    Value := StringReplace(Value, ' uur', ' uur :  ' + #13#10);
//    Value := StringReplace(Value, '<div class="forum_message_message">', #13#10);
    Value := StringReplace(Value, '</div><div class="form_horizontal_divider" ', '-------------------------------------------------------------' + #13#10 + #13#10 + '<');
    HTMLRemoveTags(Value);
    HTMLDecode(Value);
    SetField(fieldComments, Value);
  end;

end;


procedure AnalyzeResultsPage(Address: string);
var
  Page: TStringList;
  Line: string;
  GameAddress: string;
  GameTitle: string;
  aantal : integer;
begin
  // get results page
  aantal := 0;
  Page := TStringList.Create;
  Page.Text := GetPage(Address);

  // get redirect javascript
  Line := Page.GetString(Page.Count-2);

  // more than 1 game found
  if Pos('location.replace("http://www.gamesmeter.nl/game/searchresults#results");', Line) <> 0 then
  begin
    PickTreeClear;
    PickTreeAdd('Zoekresultaten voor ' + GameName, '');

    // get results page
    Page.Text := GetPage('http://www.gamesmeter.nl/game/searchresults#results');
    if Pos('Populaire zoekresultaten in games:', Page.Text) > 0 then
      Line := TextBetween(Page.Text, 'Populaire zoekresultaten in games:</p>', '<form action="http://www.gamesmeter.nl/game/search/"');
    if Pos('Alle zoekresultaten in games:', Page.Text) > 0 then
      Line := TextBetween(Page.Text, 'Alle zoekresultaten in games:</p>', '<form action="http://www.gamesmeter.nl/game/search/"');
    if Pos('Zoekresultaten in games:', Page.Text) > 0 then
      Line := TextBetween(Page.Text, 'Zoekresultaten in games:</p>', '<form action="http://www.gamesmeter.nl/game/search/"');
    Line := TextBetween(Line, '</p></div>', '<p><br /></p>');
    while Pos('gameresults_row', Line) > 0 do
    begin
      GameAddress := TextBetween(Line, 'href="', '" >');
      GameTitle := TextBefore(Line, '</p></div>', '');
      Line := RemainingText;
      HTMLRemoveTags(GameTitle);
      HTMLDecode(GameTitle);
      PickTreeAdd(Trim(GameTitle), GameAddress);
      aantal := aantal + 1;
    end;
    if aantal = 0 then
     begin
      ShowMessage('Geen resultaten gevonden...');
      Page.Free;
      exit;
     end;
    // if user picks a game from the results list, import game details
    if PickTreeExec(Address) then
      AnalyzeGamePage(Address);
  end
  else
  begin
    GameAddress := TextBetween(Line, '("', '");');
    if GameAddress <> 'http://www.gamesmeter.nl/game/' then
      // if only 1 game found --> redirect to game page
      AnalyzeGamePage(GameAddress)
    else
      // no games found
      ShowMessage('Geen zoekresultaat voor "'+GameName+'".');
  end;
  Page.Free;

end;


begin
  if CheckVersion(0,9,7) then
  begin
    if StringUtils1_Version >= 2 then
    begin
      GameName := GetField(fieldOriginalTitle);
      if GameName = '' then
        GameName := GetField(fieldTranslatedTitle);
      if Input('GamesMeter.nl Import', 'Geef de titel van de game:', GameName) then
      begin
        AnalyzeResultsPage('http://www.gamesmeter.nl/game/search/'+UrlEncode(GameName));
      end;
    end
    else
      ShowMessage('Het bestand "StringUtils1.pas" is verouderd, zoek een nieuwere versie (op zijn minst versie 2)');
  end
  else
    ShowMessage('Dit script vereist een nieuwere versie van Sisimizi Catlog (minstens versie 0.9.0)');
    exit;
end.
bad4u
Posts: 1148
Joined: 2006-12-11 22:54:46

Post by bad4u »

For adding a picklist box that shows all available platforms for the game and asks for choosing your platform, we need to define an additional string variable, and we will call this one "Temp". You need to add it to the variables part on the beginning of procedure AnalyzeGamePage :

Code: Select all

var
  PageText, Line, Value: string;
When you added "Temp", we then can use this variable on the script.

Code: Select all

  if Pos('/', Value) > 0 then
    begin
      Temp := Value;
      PickListClear;
      while Pos('/', Temp) > 0 do
        begin
          PickListAdd(TextBefore(Temp, ' / ', ''));
          Temp := RemainingText;
        end;
      PickListAdd(Temp);
      PickListExec('Available platforms for this game : ' + Value + #13#10 + #13#10 + 'Choose your platform', Value);
    end;
This is the code for the platform's picklist.
- Line1 checks if we have a game with multiple platforms (if there is a '/' on variable value, it should contain more than one platform); if so the code between begin (Line2) and end (Line12) will be executed, else it won't.
- Line3 copies variable Value to our new variable Temp; this is because we need to change content of that variable, but we need to keep original variable Value, too (to show all platforms on picklist later)
- Line4 clears the picklist so that we can use it
- Line5 is a loop that executes lines 7+8 as long as we find another '/' in Temp
- Line7 adds the text before ' / ' to the picklist; this is a single platform as you can see on game's website and then..
- Line8 copies only the remaining text (= the part behind the ' / ') to variable Temp; the result is that the platform we added to list and the first ' / ' are not longer on variable Temp anymore - so the script can look for the next ' / ' if available
- when there is no more ' / ' on Temp, the loop will be left and Line9 adds the last platform to picklist
- Line10 then shows the picklist to the user and when user picks a platform it will be saved to Value again. You should translate the english text here to dutch.

Add this code to platform import block right before you write Value to fieldPlatform there.

This was easy, was it ? Sorry ;)
Just let me know if something goes wrong.
Last edited by bad4u on 2009-02-25 20:51:25, edited 1 time in total.
bad4u
Posts: 1148
Joined: 2006-12-11 22:54:46

Post by bad4u »

Do you want to import single/multiplayer ? I'd prefer not to do so, as it does not say anything about number of players, but we can import it if you want. Just need to know where to save it then. And which field you want to import user comments/reviews to. It is imported to fieldComments so far.
pele
Posts: 72
Joined: 2009-02-21 20:25:57

Post by pele »

So this works with the games transformer. Look pretty cool to me.

Next about single/multiplayer. i hope i can explain this in english.
I saw on gamesmeter there are single /multi /online (mario kart for instance).
I think we use here for the fields localplayers and networkplayers
single = 1 localplayers
multi = 2 localplayers
online = 2 field networkplayers.
I know that at multi = 2 that can also be 4. Perhaps i can change it by myself when i play the game.
The same at online = 2 .

For me you can leave the user comment/reviews. I'm not that intrested to keep that.

I hoop you
bad4u
Posts: 1148
Joined: 2006-12-11 22:54:46

Post by bad4u »

This is quite easy to realize. You need to insert the code for single/multiplayer between the blocks for category and developer. Just use the same code as you did for category. It's only the

Code: Select all

SetField(fieldCategory, Value);
line you have to modify. Instead of saving the retrieved data to a specific field, you have to 'see' what's inside this code and then let the script write your preferred result to another field.

For a game that lists "single" you want to save "1" to fieldLocalPlayers. We will use a if .. then condition again for that. if 'single' is within Value then save '1' to field Local Players:

Code: Select all

  if Pos('single', Value) > 0 then
    SetField(fieldLocalPlayers, '1');
Add similar for "multi" and save "2" instead of "1". And for online just save "2" to the field for network players.

That's it. This wasn't too hard, I guess.

You should know that user comments worked all the time, we do not need to add them. If you cannot see them on import, you need to set script option "ImportComments" to "1" (it's on the right side of scripting window when you mark the script on the list).

So script has been nearly finished. Now you should do some tests with a couple of games. and see if it works like expected or if there are still games that fail to import correctly - this could happen if the structure of game details is different from most other games (e.g. category is missing). If it is working fine, please paste the full script (with header included, so please copy from an external editor like you did on your first script posting) for the last time, to have one more look on it and clean up and/or correct just a few lines. Then it should be ready for release..
pele
Posts: 72
Joined: 2009-02-21 20:25:57

Post by pele »

Here are almost the final results.

Code: Select all

(***************************************************

Sisimizi Game Catalog importation script
http://www.sisimizi.org

[Infos]
Authors=Bianca Manglie
Title=GamesMeter.nl
Description=GamesMeter.nl import script
Site=www.gamesmeter.nl
Language=NL
Version=0.1.0
Requires=0.9.0
Comments=
License=This program is free software; you can redistribute it and/or modify it under the  terms of the GNU General Public License as published by the Free Software Foundation;  either version 2 of the License, or (at your option) any later version. |
GetInfo=1

[Options]
AllCountries=0|0|0=Take only first country|1=Take all countries (separated by "/")
ImportComments=0|0|0=Do not import users' comments|1=Import users' comments

***************************************************)

program GamesMeter;

uses
  StringUtils1;

var
  GameName: string;

procedure AnalyzeGamePage(Address: string);
var
  PageText, Line, Temp, Value: string;
begin
  PageText := GetPage(Address);

  // URL
  SetField(fieldURL, Address);

  // title & year
  Line := TextBetween(PageText, '<h1>', '</h1>');
  Value := TextBetween(Line, '(', ')');
  SetField(fieldYear, Value);
  Value := Trim(TextBefore(Line, '(', ''));
  HTMLDecode(Value);
  SetField(fieldOriginalTitle, Value);

  // 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, '>');
  if Pos('>meer..', Value) > 0 then
    begin
      Value := TextBetween(PageText, 'id="platforms_all">', '</span>');
      Line := RemainingText;
    end;
  if Pos('/', Value) > 0 then
    begin
      Temp := Value;
      PickListClear;
      while Pos('/', Temp) > 0 do
        begin
          PickListAdd(TextBefore(Temp, ' / ', ''));
          Temp := RemainingText;
        end;
      PickListAdd(Temp);
      PickListExec('Beschikbare platforms voor deze game : ' + Value + #13#10 + #13#10 + 'Kies het platform', Value);
    end;
  setField(fieldPlatform, Value);

  // Category
  Value := TextBefore(Line, '<br />', '');
  Line := RemainingText;
  HTMLDecode(Value);
  SetField(fieldCategory, Value);
  
  // player
  Value := TextBefore(Line, '<br />', '');
  Line := RemainingText;
  HTMLDecode(Value);
  if Pos('single', Value) > 0 then
    SetField(fieldLocalPlayers, '1');
  if Pos('multi', Value) > 0 then
    SetField(fieldLocalPlayers, '2');
  if Pos('online', Value) > 0 then
    SetField(fieldNetworkPlayers, '2');

  // Developer
  Value := TextBetween(line, '>Ontwikkeld door ', '<br />');
  Line := RemainingText;
  HTMLRemoveTags(Value);
  HTMLDecode(Value);
  Value := StringReplace(Value, ' en ', ', ');
  SetField(fieldDeveloper, Value);
  
  // publisher
  Value := TextBetween(line, 'Uitgegeven door ', '<br />');
  Line := RemainingText;
  HTMLRemoveTags(Value);
  HTMLDecode(Value);
  Value := StringReplace(Value, ' en ', ', ');
  SetField(fieldPublisher, Value);

  // Description
  Value := TextBetween(Line, '<br />', '</div>');
  HTMLRemoveTags(Value);
  HTMLDecode(Value);
  SetField(fieldDescription, Value);

  // Picture
  Value := TextBetween(PageText, '<img class="poster" src="', '" ');
  if Value <> '' then
  begin
    GetPicture(Value);
  end;

  // Rating
  Value := TextBetween(PageText, '</span>gemiddelde <b>', '<');
  Value := StringReplace(FloatToStr(StrToFloat(StringReplace(Value, ',', '.')) * 2), ',', '.');
  SetField(fieldRating, Value);

  // Comments
  if GetOption('ImportComments') = 1 then
  begin
    Value := TextBetween(PageText, '<div class="forum_message_user">', '<div class="to_page entitypages" id="pages_bottom"></div>');
    Value := StringReplace(Value, ' uur', ' uur :  ' + #13#10);
//    Value := StringReplace(Value, '<div class="forum_message_message">', #13#10);
    Value := StringReplace(Value, '</div><div class="form_horizontal_divider" ', '-------------------------------------------------------------' + #13#10 + #13#10 + '<');
    HTMLRemoveTags(Value);
    HTMLDecode(Value);
    SetField(fieldComments, Value);
  end;

end;


procedure AnalyzeResultsPage(Address: string);
var
  Page: TStringList;
  Line: string;
  GameAddress: string;
  GameTitle: string;
  aantal : integer;
begin
  // get results page
  aantal := 0;
  Page := TStringList.Create;
  Page.Text := GetPage(Address);

  // get redirect javascript
  Line := Page.GetString(Page.Count-2);

  // more than 1 game found
  if Pos('location.replace("http://www.gamesmeter.nl/game/searchresults#results");', Line) <> 0 then
  begin
    PickTreeClear;
    PickTreeAdd('Zoekresultaten voor ' + GameName, '');

    // get results page
    Page.Text := GetPage('http://www.gamesmeter.nl/game/searchresults#results');
    if Pos('Populaire zoekresultaten in games:', Page.Text) > 0 then
      Line := TextBetween(Page.Text, 'Populaire zoekresultaten in games:</p>', '<form action="http://www.gamesmeter.nl/game/search/"');
    if Pos('Alle zoekresultaten in games:', Page.Text) > 0 then
      Line := TextBetween(Page.Text, 'Alle zoekresultaten in games:</p>', '<form action="http://www.gamesmeter.nl/game/search/"');
    if Pos('Zoekresultaten in games:', Page.Text) > 0 then
      Line := TextBetween(Page.Text, 'Zoekresultaten in games:</p>', '<form action="http://www.gamesmeter.nl/game/search/"');
    Line := TextBetween(Line, '</p></div>', '<p><br /></p>');
    while Pos('gameresults_row', Line) > 0 do
    begin
      GameAddress := TextBetween(Line, 'href="', '" >');
      GameTitle := TextBefore(Line, '</p></div>', '');
      Line := RemainingText;
      HTMLRemoveTags(GameTitle);
      HTMLDecode(GameTitle);
      PickTreeAdd(Trim(GameTitle), GameAddress);
      aantal := aantal + 1;
    end;
    if aantal = 0 then
     begin
      ShowMessage('Geen resultaten gevonden...');
      Page.Free;
      exit;
     end;
    // if user picks a game from the results list, import game details
    if PickTreeExec(Address) then
      AnalyzeGamePage(Address);
  end
  else
  begin
    GameAddress := TextBetween(Line, '("', '");');
    if GameAddress <> 'http://www.gamesmeter.nl/game/' then
      // if only 1 game found --> redirect to game page
      AnalyzeGamePage(GameAddress)
    else
      // no games found
      ShowMessage('Geen zoekresultaat voor "'+GameName+'".');
  end;
  Page.Free;

end;


begin
  if CheckVersion(0,9,7) then
  begin
    if StringUtils1_Version >= 2 then
    begin
      GameName := GetField(fieldOriginalTitle);
      if GameName = '' then
        GameName := GetField(fieldTranslatedTitle);
      if Input('GamesMeter.nl Import', 'Geef de titel van de game:', GameName) then
      begin
        AnalyzeResultsPage('http://www.gamesmeter.nl/game/search/'+UrlEncode(GameName));
      end;
    end
    else
      ShowMessage('Het bestand "StringUtils1.pas" is verouderd, zoek een nieuwere versie (op zijn minst versie 2)');
  end
  else
    ShowMessage('Dit script vereist een nieuwere versie van Sisimizi Catlog (minstens versie 0.9.0)');
    exit;
end.
bad4u
Posts: 1148
Joined: 2006-12-11 22:54:46

Post by bad4u »

Works quite nice it seems. So as I mentioned before, some last notes and changes :

In editor mode click "Properties":

- You deleted original author of moviemeter script, this should be added again as most of the code was done by him. You could add a "Based on MovieMeter (NL) script by Antoine Potten" to "Comments" field.
- If script seems to work fine and you gonna release it, set "Version" to 1.0 or 1.0.0
- Still on the "Properties" window you can see script options field. Click on "AllCountries" and delete it, as it is not used by the script anymore.
- Click on script option "ImportComments" and on the right side of the window set "Default" to "1". This makes import of user comments the default setting when script is run for the first time - else many users might miss this option. Who doesn't want to import comments can switch it off later on script options (on the list).
- Click "Save".

On the script:

- On blocks that have an

Code: Select all

  HTMLDecode(Value);
for variable Value but no

Code: Select all

  HTMLRemoveTags(Value);
(e.g. title & year, translated title, etc) you should add the HTMLRemoveTags line, as it's just in case that website should somewhere use links on imported strings.

- on comments block add an additional

Code: Select all

Value := StringReplace(Value, '[permalink] ', '');
right before you write Value to fieldComments. This will delete the annoying [permalink] from each comment.

- Change line

Code: Select all

if CheckVersion(0,9,7) then
to version 0.9.0, so that script runs on previous SGC versions and version numbering is consistent with preferences.

As I mentioned earlier, script import might fail for games that do not have all details like category or single/multiplayers on its page. If there should be a problem someone will report it, I guess. It can be fixed if such a game should be found.

Congrats. You have your full script. Feel free to release it for others if you like.

PS: I hope I did not annoy you with forcing you to do code changes on your own. It would have been a lot faster and easier for me just writing and releasing this script. But as I said I hope it might be helpful for others who try fixing a script for the first time. If you once have understood how a script works and how you should handle and search HTML sources of the website for changes, it is quite easy to fix minor bugs - at least if someone is interested in learning it. Have fun ;)
pele
Posts: 72
Joined: 2009-02-21 20:25:57

Post by pele »

Well i like to learn scripting. It's a bit late because i can write and read html but no scripts.
So this was very helpfull to to it on my own with help from you.

As i'm on my work now i can't change the script. In ancoming weekend i will change it and release the script.

What is the procedure? must i send it sisimize and antp?

Grtz Bianca
antp
Site Admin
Posts: 9639
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

If it is not for movies, it has nothing to do with me ;)
bad4u
Posts: 1148
Joined: 2006-12-11 22:54:46

Post by bad4u »

You can release it on Sisimizi forum. There you don't need to paste it, it has a function to attach script files to your posting.

PS: Maybe you should edit topic on your first posting from Change moviemeter script to something like Change moviemeter to gamesmeter script to make it more obvious for users who search the forum what this topic is about ;)
antp
Site Admin
Posts: 9639
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

Maybe I should move this topic to "Mods" section btw?
bad4u
Posts: 1148
Joined: 2006-12-11 22:54:46

Post by bad4u »

Sure. Eventually keeping a "moved to" for a while ?
antp
Site Admin
Posts: 9639
Joined: 2002-05-30 10:13:07
Location: Brussels
Contact:

Post by antp »

You mean keeping it visible in "Scripts" section ? Sure.
pele
Posts: 72
Joined: 2009-02-21 20:25:57

Post by pele »

Hoi,

We'll i did all the changes and i'm using the script now for myself. I asked sisimizi if i can upload the script.

I wanna thank you for the help. Hopefully i can fix minor bugs on my own.

Thank you very much.

Grtz, Bianca
Post Reply