echo json_encode($resp); break; case "getAccounts": if (!$api->ifUserLogined()) { echo 'reload'; } else { $accounts = new SimpleXMLElement($api->getAccountsData('accounts', true)); // second param: bool <= skip_cache echo json_encode($accounts); } break; case "getPosts": if (!$api->ifUserLogined()) { echo 'reload'; } else { $resp = $api->getScheduledPosts(); for ($i = 0; $i < count($resp->posts->post); $i++) { for ($ai = 0; $ai < count($resp->posts->post[$i]->accounts->account); $ai++) { $resp->posts->post[$i]->accounts->account[$ai]->accountId = $api->getI($resp->posts->post[$i]->accounts->account[$ai]->accountId); for ($aj = 0; $aj < count($resp->posts->post[$i]->accounts->account[$ai]->config->sampleId); $aj++) { $resp->posts->post[$i]->accounts->account[$ai]->config->sampleId[$aj] = $api->getJ(intval($resp->posts->post[$i]->accounts->account[$ai]->accountId), $resp->posts->post[$i]->accounts->account[$ai]->config->sampleId[$aj]); } } } echo json_encode($resp->posts); } break; case "deletePost": if (isset($_POST['id'])) { $resp = $api->deleteScheduledPost($_POST['id']); echo $resp->description;