PHP code example of netzmacht / tapatalk-client-api

1. Go to this page and download the library: Download netzmacht/tapatalk-client-api 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/ */

    

netzmacht / tapatalk-client-api example snippets




// you don't have to use user credentials. if not passed not all features are available
$client = Netzmacht\Tapatalk\Factory::connect('http://example.com/forum/mobiquo/mobiquo.php', 'user', 'password');

// check if private messages are available
$client->config()->isPushTypeEnabled(Netzmacht\Tapatalk\Api\Config::PUSH_PRIVATE_MESSAGE);

$searchResult = $client->posts()->advancedSearch(array(
       Netzmacht\Tapatalk\Api\Search\AdvancedSearch::KEYWORDS => 'my keywords',
       Netzmacht\Tapatalk\Api\Search\AdvancedSearch::USERNAME => 'myuser',
       Netzmacht\Tapatalk\Api\Search\AdvancedSearch::ONLY_IN  => array(12, 43, 10), // forum ids
   )
   20, // limit
   60,  // offset
);

$searchResult->getTotal(); // total posts. useful to
$searchResult->hasMore(); // returns true if given result is not as big as total posts

foerach($searchResult as $post) {
    $post->getAuthor()->getUsername();
}