X-Git-Url: http://git.shiar.nl/sc2-widget/blobdiff_plain/203777569f73b769b10164e3b37e8183e8d8c900..cbae85142a87301b7e7c3d881550e31b5472c12c:/widget.php diff --git a/widget.php b/widget.php index e222f22..d1b3b88 100644 --- a/widget.php +++ b/widget.php @@ -26,7 +26,14 @@ if ($last < time() - 3600) { if (is_numeric($request)) { $recipe = $request; } - elseif (!$last) { + 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)); + } + } + else { error("Unknown profile request $request", 400); }