No exercises programmed for this date.
Rate of Perceived Exertion
1. Create a file named config.php with: <?php define('APP_PIN', '1234'); ?>2. Create api.php with the code below:
config.php
<?php define('APP_PIN', '1234'); ?>
api.php
<?php header('Content-Type: application/json'); header('Access-Control-Allow-Origin: *'); require_once 'config.php'; $date = $_GET['date'] ?? date('Y-m-d'); $date = preg_replace('/[^0-9\-]/', '', $date); if(!$date) $date = date('Y-m-d'); $dataDir = 'data'; if (!is_dir($dataDir)) { mkdir($dataDir, 0755, true); } $file = "$dataDir/workout_$date.json"; if (isset($_GET['action']) && $_GET['action'] === 'auth') { $input = json_decode(file_get_contents('php://input'), true); if (isset($input['pin']) && (string)$input['pin'] === (string)APP_PIN) { echo json_encode(['status' => 'success']); } else { echo json_encode(['status' => 'error']); } exit; } if ($_SERVER['REQUEST_METHOD'] === 'POST') { $input = json_decode(file_get_contents('php://input'), true); if (!isset($input['auth_pin']) || (string)$input['auth_pin'] !== (string)APP_PIN) { http_response_code(403); echo json_encode(['status' => 'error', 'message' => 'Invalid PIN']); exit; } if (isset($input['data'])) { file_put_contents($file, json_encode($input['data'])); echo json_encode(['status' => 'success', 'date' => $date]); } else { echo json_encode(['status' => 'error', 'message' => 'No data found']); } } else { if (file_exists($file)) { echo file_get_contents($file); } else { echo json_encode(['blocks' => [], 'date' => $date]); } } ?>