WIP cscg24

This commit is contained in:
2024-03-02 02:46:14 +01:00
parent 4993c1ff1d
commit cd68823bf5
41 changed files with 22825 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
<?php
$input = json_decode(file_get_contents('php://input'), true);
if (!isset($input["code"])) {
echo json_encode(array("error" => "no input data"));
die();
}
$tmpfname = tempnam("/tmp", "lolpython_prog_");
$handle = fopen($tmpfname, "w");
fwrite($handle, $input["code"]);
fclose($handle);
$stdout = shell_exec("python2 /opt/lolcode.py $tmpfname");
echo(json_encode(array("result" => $stdout)));
?>