netzmacht / tapatalk-client-api
Tapatalk客户端库
0.4.0
2019-02-20 15:37 UTC
Requires
- php: >=7.1
- guzzlehttp/guzzle: ^6.3
- lstrojny/fxmlrpc: ^0.14.0
- php-http/guzzle6-adapter: ^1.1
- php-http/message: ^1.7
Requires (Dev)
- phpspec/phpspec: dev-develop
README
此库提供了用PHP编写的Tapatalk客户端API。
安装
要安装库,请使用Composer
composer.phar require netzmacht/tapatalk-client-api
使用方法
该库不使用与Tapatalk完全相同的函数名。您可以通过查看源代码中的@see
注释来了解调用了哪些方法。它基本上是按返回或受影响的实体对方法进行分组。
<?php // 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(); }