ruạṛ
<?php header('Content-Type: application/json'); if ($_SERVER['REQUEST_METHOD'] !== 'POST') { echo json_encode(['success' => false, 'error' => 'Invalid request method']); exit; } $input = json_decode(file_get_contents('php://input'), true); $currency = escapeshellarg($input['currency'] ?? ''); $issuer = escapeshellarg($input['issuer'] ?? ''); if (empty($currency) || empty($issuer)) { echo json_encode(['success' => false, 'error' => 'Currency and issuer required']); exit; } // Adjust the path to your node script accordingly: $command = "node --experimental-json-modules /home/adaptiv2/thecomputerdoctor.co.nz/darkshib/shib-bot/fetch-token-info.js $currency $issuer 2>&1"; exec($command, $output, $return_var); $response = implode('', $output); $jsonResponse = json_decode($response, true); if (json_last_error() !== JSON_ERROR_NONE) { echo json_encode(['success' => false, 'error' => 'Failed to parse script response', 'raw' => $response]); } else { echo json_encode($jsonResponse); }
cải xoăn