Exemple #1
0
     // 		$result = $connection->post ( 'direct_messages/new', array (
     // 				'user_id' => $_POST ['user_id'],
     // 				'text' => $_POST ['text']
     // 		) );
     // 		echo json_encode ( $result );
     // 	}
     // }
     break;
 case 'TWFriends':
     if (isset($_POST['i']) && isset($_POST['j'])) {
         $acc_data = $api->getAccountData($_POST['i'], $_POST['j']);
         if ($acc_data == 'reload') {
             echo "Reload page";
         } else {
             if (Server_Side) {
                 $result = $api->getTWFriends($acc_data->accountId, $acc_data->sampleId);
             } else {
                 $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, (string) $acc_data->user_at, (string) $acc_data->user_ts);
                 $array = array('user_id' => (string) $acc_data->userId);
                 $result = $connection->get('friends/ids', $array);
             }
             echo json_encode($result);
         }
     } else {
         echo "Incorrect data";
     }
     break;
 case 'TWFollow':
     // if (isset ( $_POST ['i'] ) && isset ( $_POST ['j'] ) && isset ( $_POST ['user_id'] )) {
     // 	$acc_data = $api->getAccountData ( $_POST ['i'], $_POST ['j'] );
     // 	if ($acc_data == 'reload') {