summaryrefslogtreecommitdiff
path: root/htdocs/public/metranslator/api
diff options
context:
space:
mode:
Diffstat (limited to 'htdocs/public/metranslator/api')
-rw-r--r--htdocs/public/metranslator/api/index.ejs31
1 files changed, 0 insertions, 31 deletions
diff --git a/htdocs/public/metranslator/api/index.ejs b/htdocs/public/metranslator/api/index.ejs
deleted file mode 100644
index fa915b4..0000000
--- a/htdocs/public/metranslator/api/index.ejs
+++ /dev/null
@@ -1,31 +0,0 @@
-<%
-
- res.writeHead(200, {'Content-Type': "application/json"});
-
- if (get['t']) {
- if (get['t'] === "en") {
- target = "en";
- } else {
- target = "mt";
- }
- } else {
- res.end();
- }
-
- if (get['u']) {
- text = get['u'];
-
- if (text.length > 500) {
- res.end();
- }
-
- text = text.split("\"").join("''");
- } else {
- res.end();
- }
-
- aw = JSON.parse(child_process.execSync(`cd /mnt/metranslator-api && node index.js api ${target} "${text}"`).toString());
- last = child_process.execSync("cd /mnt/metranslator-api && git log -1 --pretty=format:'%an'").toString()
- aw["system"]["version"] = aw["system"]["version"] + "-" + fs.readFileSync("/mnt/metranslator-api/.git/refs/heads/trunk").toString().substr(0, 8);
- aw["system"]["last_author"] = last;
- aw["call"] = "cd /mnt/metranslator-api && node index.js api {$target} \"{$text}\""; \ No newline at end of file