imorate / twitchfa-api
This package is abandoned and no longer maintained.
No replacement package was suggested.
PHP REST API client for Twitchfa.com
v1.0
2021-03-23 11:24 UTC
Requires
- php: ^7.2
- ext-json: *
- guzzlehttp/guzzle: ~7.2
Requires (Dev)
- phpunit/phpunit: ~8.5.15
- roave/security-advisories: dev-master
README
Twitchfa-api client written with PHP for Twitchfa based on Coingecko-Api structure
For additional information about API visit Twitchfa v2 documentation
Requirements
- PHP >= 7.52
- ext-json
- guzzlehttp/guzzle
Installation
The preferred way to install this extension is through composer.
Either run
$ composer require imorate/twitchfa-api
or add
"imorate/twitchfa-api": "^1.0"
Basic usage
Example
use Twitchfa\TwitchfaClient; $client = new TwitchfaClient(); $result = $client->twitch()->searchStreamers('mechiller');
You can get last response (ResponseInterface::class
) uses getLastResponse
method:
use Twitchfa\TwitchfaClient; $client = new TwitchfaClient(); $result = $client->twitch()->searchStreamers('fk_orca'); $response = $client->getLastResponse(); $headers = $response->getHeaders();
Available methods
Twitch
use Twitchfa\TwitchfaClient; $client = new TwitchfaClient(); $result = $client->twitch()->getBanners();
use Twitchfa\TwitchfaClient; $client = new TwitchfaClient(); $result = $client->twitch()->getNotifications();
use Twitchfa\TwitchfaClient; $client = new TwitchfaClient(); $result = $client->twitch()->searchStreamers('fk_orca');
use Twitchfa\TwitchfaClient; $client = new TwitchfaClient(); $accessToken = 'eyJhbGciOiJSUzI...'; $result = $client->twitch()->getFollowing($accessToken);
use Twitchfa\TwitchfaClient; $client = new TwitchfaClient(); $accessToken = 'eyJhbGciOiJSUzI...'; $result = $client->twitch()->getSelf($accessToken);
use Twitchfa\TwitchfaClient; $client = new TwitchfaClient(); $result = $client->twitch()->getStreamers(1,10);
use Twitchfa\TwitchfaClient; $client = new TwitchfaClient(); $result = $client->twitch()->addStreamer('some_random_username');
use Twitchfa\TwitchfaClient; $client = new TwitchfaClient(); $result = $client->twitch()->getTwitchStats();