api-clients / twitter
异步优先的Twitter客户端
dev-master
2019-04-29 20:04 UTC
Requires
- php: ^7.0
- api-clients/client-services: ^1.4
- api-clients/foundation: ^1.0
- api-clients/middleware-http-exceptions: ^2.0
- api-clients/middleware-json: ^3.1
- api-clients/middleware-oauth1: ^4.0
- api-clients/middleware-user-agent: ^2.0
- api-clients/rx: ^2.2
- api-clients/rx-operators: ^2.0
- react/http-client: >=0.4.17
Requires (Dev)
This package is auto-updated.
Last update: 2024-09-15 04:31:21 UTC
README
安装
要通过Composer安装,请使用以下命令,它将自动检测最新版本并将其绑定到^
。
composer require api-clients/twitter
使用方法
<?php use React\EventLoop\Factory; use ApiClients\Client\Twitter\AsyncClient; use ApiClients\Client\Twitter\Resource\UserInterface; use function ApiClients\Foundation\resource_pretty_print; require 'vendor/autoload.php'; $config = require 'resolve_config.php'; $loop = Factory::create(); $client = (new AsyncClient( $config['consumer']['key'], $config['consumer']['secret'], $loop ))->withAccessToken( $config['access_token']['token'], $config['access_token']['secret'] ); $client->user('php_api_clients')->done(function (UserInterface $user) { resource_pretty_print($user); }); $loop->run();
许可证
MIT许可证(MIT)
版权所有 (c) 2018 Cees-Jan Kiewiet
在此特此授予任何人获得此软件及其相关文档文件(“软件”)的副本(“软件”)的权利,免费使用软件,包括但不限于使用、复制、修改、合并、发布、分发、再许可和/或销售软件的副本,并允许获得软件的人进行此类操作,但受以下条件约束
上述版权声明和本许可声明应包含在软件的所有副本或主要部分中。
软件按“原样”提供,不提供任何形式的保证,明示或暗示,包括但不限于适销性、适用于特定用途和侵权保证。在任何情况下,作者或版权所有者均不对任何索赔、损害或其他责任承担责任,无论是否基于合同、侵权或其他原因,无论是否因软件或其使用或其他方式而产生。