From 4d46f04b5ec1a9a7fbf8a5701fe7332f56080232 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Wed, 22 May 2019 23:59:55 +0200 Subject: [PATCH] rerequest clans from previous profile data Transfer ids from include to override, so only a baseline needs to be given on setup and it will automatically remember and supplement found members. --- widget.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/widget.php b/widget.php index 78f0ab2..d1b3b88 100644 --- a/widget.php +++ b/widget.php @@ -26,11 +26,14 @@ if ($last < time() - 3600) { if (is_numeric($request)) { $recipe = $request; } - elseif ($request == 'inno') { - #TODO: get ids from existing data - $recipe = "$request 2138280 6531490"; + elseif ($last) { + if ($data = json_decode(file_get_contents($target), true)) { + $profiles = array_column($data['members'], 'profileId'); + #TODO: reduce profiles by checking ladder presence + $recipe = join(' ', array_merge([$request], $profiles)); + } } - elseif (!$last) { + else { error("Unknown profile request $request", 400); } -- 2.30.0