stavarengo / deep-social-php-api-client
http://deep.social API 的 PHP 客户端库
v0.0.5
2019-03-15 12:38 UTC
Requires
- php: ^7.1
- guzzlehttp/guzzle: ~6.0
- psr/cache: ^1.0
- psr/container: ^1.0
- psr/http-message: ^1.0
README
http://deep.social API 的 PHP 客户端库
如果你对 Deep.Social 的 PHP API 感兴趣,这就是你的库 :)
关于它
- 仅依赖于 PSRs。
- 可选使用缓存以避免浪费 DeepSocial 信用点请求已经拥有的数据。
- 你可以将它用于任何应用程序,无论是使用还是不使用 PSR-11 的工厂。
- 由于我尽量让所有源代码都有良好的文档,所以它应该非常容易使用。
安装
通过 composer
安装。
composer require stavarengo/deep-social-php-api-client:^0.0
基本用法 - 更详细的文档即将到来
-
直接使用(不使用工厂)。
$client = new \Sta\DeepSocialPhpApiClient\Client('YOUR_DEPPSOCIAL_API_TOKEN', null);// This 'null' means: "no cache" $response = $client->getAudienceData('@SOME_INSTAGRAM_USER_NAME'); var_dump($response->hasError() ? $response->getErrorEntity() : $response->getEntity());
-
使用我们的默认工厂(PSR-11)。
$client = $container->get(\Sta\DeepSocialPhpApiClient\Client::class) var_dump($response->hasError() ? $response->getErrorEntity() : $response->getEntity());