diff options
author | Minteck <contact@minteck.org> | 2021-12-16 23:06:28 +0100 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2021-12-16 23:06:28 +0100 |
commit | 45557cdd61850abc30959c39054d29b45fefb8c2 (patch) | |
tree | 60f0ec310aae36eeb020b7ba5796bdd4b84d4607 /htdocs/public/metranslator/api/index.ejs | |
parent | 7769ba124e9325a4848ca2925241de0526bd6a4e (diff) | |
download | wolfeye-js-45557cdd61850abc30959c39054d29b45fefb8c2.tar.gz wolfeye-js-45557cdd61850abc30959c39054d29b45fefb8c2.tar.bz2 wolfeye-js-45557cdd61850abc30959c39054d29b45fefb8c2.zip |
It's finally done!
Diffstat (limited to 'htdocs/public/metranslator/api/index.ejs')
-rw-r--r-- | htdocs/public/metranslator/api/index.ejs | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/htdocs/public/metranslator/api/index.ejs b/htdocs/public/metranslator/api/index.ejs deleted file mode 100644 index 388331b..0000000 --- a/htdocs/public/metranslator/api/index.ejs +++ /dev/null @@ -1,33 +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}\""; - - %><%- JSON.stringify(aw); %>
\ No newline at end of file |