$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, (string) $acc_data->user_at, (string) $acc_data->user_ts); $array = array('include_entities' => 'true'); if (isset($_POST['max_id'])) { $array['max_id'] = $_POST['max_id']; } $result = $connection->get('direct_messages/sent', $array); echo json_encode($result); } break; case 'getTWRetweets': // $acc_data = $api->getAccountData ( $_POST ['i'], $_POST ['j'] ); $acc_data = $api->getAccountDataByID($_POST['accountID'], $_POST['profileID']); if ($acc_data == 'reload') { echo "Reload page"; } else { echo $api->getTWRetweetsFromServer($acc_data->userId, $acc_data->accountId, $acc_data->user_at, $acc_data->user_ts); } break; case 'getTWFavorites': // $acc_data = $api->getAccountData ( $_POST ['i'], $_POST ['j'] ); $acc_data = $api->getAccountDataByID($_POST['accountID'], $_POST['profileID']); if ($acc_data == 'reload') { echo "Reload page"; } else { echo $api->getTWFavoritesFromServer($acc_data->userId, $acc_data->accountId, $acc_data->user_at, $acc_data->user_ts); } break; case 'getTWFollowers': // $acc_data = $api->getAccountData ( $_POST ['i'], $_POST ['j'] ); $acc_data = $api->getAccountDataByID($_POST['accountID'], $_POST['profileID']); if ($acc_data == 'reload') {