build current_gamer json
authorChristian Weiske <cweiske@cweiske.de>
Sat, 4 Jan 2020 23:50:20 +0000 (00:50 +0100)
committerChristian Weiske <cweiske@cweiske.de>
Sat, 4 Jan 2020 23:50:20 +0000 (00:50 +0100)
bin/import-game-data.php

index d4033af..5486ef5 100755 (executable)
@@ -113,6 +113,12 @@ foreach ($developers as $developer) {
         . '/products/index.htm',
         buildDeveloperProducts($developer['products'], $developer['info'])
     );
+    writeJson(
+        //index.htm does not need a rewrite rule
+        'api/v1/developers/' . $developer['info']->uuid
+        . '/current_gamer',
+        buildDeveloperCurrentGamer()
+    );
 }
 
 writeJson('api/v1/discover-data/discover.json', buildDiscover($games));
@@ -432,6 +438,16 @@ function buildDetails($game)
     ];
 }
 
+function buildDeveloperCurrentGamer()
+{
+    return [
+        'gamer' => [
+            'uuid'     => '00702342-0000-1111-2222-c3e1500cafe2',
+            'username' => 'stouyapi',
+        ],
+    ];
+}
+
 /**
  * For /api/v1/developers/xxx/products/?only=yyy
  */