2017 © Pedro Peláez
 

library my-anime-list-browser-bundle

MyAnimeList.net API browser

image

anime-db/my-anime-list-browser-bundle

MyAnimeList.net API browser

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

MyAnimeList.com, (*1)

Latest Stable Version Total Downloads Build Status Coverage Status Scrutinizer Code Quality SensioLabs Insight StyleCI License, (*2)

MyAnimeList.net API browser

Installation

Pretty simple with Composer, run:, (*3)

composer require anime-db/my-anime-list-browser-bundle

Add AnimeDbWorldArtBrowserBundle to your application kernel, (*4)

// app/appKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new AnimeDb\Bundle\MyAnimeListBrowserBundle\AnimeDbMyAnimeListBrowserBundle(),
    );
}

Configuration

anime_db_my_anime_list_browser:
    # Host name
    # As a default used 'http://myanimelist.net'
    host: 'http://myanimelist.net'

    # HTTP User-Agent
    # No default value
    client: 'My Custom Bot 1.0'

Usage

First get browser, (*5)

$browser = $this->get('anime_db.my_anime_list.browser');

Get info for anime Cowboy Bebop:, (*6)

$content = $browser->get('/anime/1');

Catch exceptions, (*7)

use AnimeDb\Bundle\MyAnimeListBrowserBundle\Exception\BannedException;
use AnimeDb\Bundle\MyAnimeListBrowserBundle\Exception\NotFoundException;

try {
    $content = $browser->get('/anime/1');
} catch (BannedException $e) {
    // you are banned
} catch (NotFoundException $e) {
    // page not found
} catch (\Exception $e) {
    // other exceptions
}

You can customize request options. See Guzzle Documentation., (*8)

License

This bundle is under the GPL v3 license. See the complete license in the file: LICENSE, (*9)

The Versions