PHP code example of keyvanakbary / tuenti

1. Go to this page and download the library: Download keyvanakbary/tuenti library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

keyvanakbary / tuenti example snippets




uenti\Client;
use Tuenti\ApiError;

$t = new Client('[email protected]', 'password');

try {
    $profile = $t->getProfile($t->me());
} catch (ApiError $e) {
    error_log($e->getMessage());
}

$t->getProfile($t->me());

getProfile($userId)

getProfileWallWithStatus($userId [, $page = 0 [, $size = 10]])

getFriends()

setStatus($status)

getPersonalNotifications()

getFriendsNotifications([$page = 0 [, $size = 10]])

getInbox([$page = 0 [, $size = 10]])

getSentBox([$page = 0 [, $size = 10]])

getSpamBox([$page = 0 [, $size = 10]])

getThread($threadKey [, $page = 0 [, $size = 10]])

sendMessage($userId, $threadKey, $message)

getAlbums($userId [, $page = 0 [, $size = 10]])

getAlbumPhotos($userId, $albumId [, $page = 0])

getPhotoTags($photoId)

addPostToPhotoWall($photoId, $message)

getPhotoWall($photoId [, $page = 0 [, $size = 10]])

foreach ($t->getAlbums($t->me()) as $albumId => $album) {
    // do something with $album
    for ($i = 0; $i < $album['size']; $i = $i + Client::DEFAULT_PAGE_SIZE) {
        $page = floor($i / Client::DEFAULT_PAGE_SIZE);
        $photos = current($t->getAlbumPhotos($t->me(), $albumId, $page));
        foreach ($photos as $photo) {
            // do something with $photo
        }
    }
}

getUpcomingEvents([$size = 10 [, $

getEvent($eventId)

getEventWall($eventId [, $page = 0 [, $size = 10]])