async-bot/imdb-plugin

dev-master 2019-11-29 10:54 UTC

This package is auto-updated.

Last update: 2024-11-29 05:57:15 UTC


README

Latest Stable Version Build Status Coverage Status License

Usage

<?php declare(strict_types=1);

use Amp\Http\Client\Client;
use AsyncBot\Plugin\Imdb\Plugin;
use AsyncBot\Plugin\Imdb\ValueObject\ApiKey;
use function Amp\Promise\wait;

require_once __DIR__ . '/vendor/autoload.php';

$httpClient = new \AsyncBot\Core\Http\Client(new Client());

// search title by imdb id
var_dump(wait((new Plugin($httpClient, new ApiKey('YOUR_API_KEY')))->getByImdbId('tt3896198')));

// search title by title
var_dump(wait((new Plugin($httpClient, new ApiKey('YOUR_API_KEY')))->searchByTitle('pulp fiction')));