Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stavarengo/twitter-php-api-client
Twitter PHP API Client
https://github.com/stavarengo/twitter-php-api-client
Last synced: 8 days ago
JSON representation
Twitter PHP API Client
- Host: GitHub
- URL: https://github.com/stavarengo/twitter-php-api-client
- Owner: stavarengo
- License: mit
- Created: 2018-03-03T20:16:31.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-03-14T20:54:43.000Z (almost 6 years ago)
- Last Synced: 2024-12-09T15:53:08.809Z (about 1 month ago)
- Language: PHP
- Homepage:
- Size: 18.6 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# twitter-php-api-client
PHP Client Library for https://developer.twitter.com APIIf you are interested in a PHP API for [Twitter](https://developer.twitter.com), that's your library :)
## About It
- Depends only on PSRs.
- Optionally use cache to use less requests and speed up response.
- You can use it with any application, either if it uses or not factories from PSR-11.
- It should be very easy to use, since I tried to keep all the source code well documented.
## Installation
Install via `composer`.```
composer require stavarengo/twitter-php-api-client:^0.0
```## Basic Usage - More complete documentation yet to come
- Use it directly (without a factory).
```php
$client = new \Sta\TwitterPhpApiClient\TwitterClient(null);$authResponse = $client->postOauth2Token($consumerKey, $consumerSecret);
$response = $client->getUsersShow('@username', false, $authResponse->getEntityBearerToken());
var_dump($response->hasError() ? $response->getEntityError() : $response->getEntityUser());
```- Use our default factory (PSR-11).
```php
$client = $container->get(\Sta\TwitterPhpApiClient\Client::class)
$authResponse = $client->postOauth2Token($consumerKey, $consumerSecret);
$response = $client->getUsersShow('@username', false, $authResponse->getEntityBearerToken());
var_dump($response->hasError() ? $response->getEntityError() : $response->getEntityUser());
```