2017 © Pedro Peláez
 

library ani-db-browser-bundle

Plugin AniDB for the catalog Anime DB

image

anime-db/ani-db-browser-bundle

Plugin AniDB for the catalog Anime DB

  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 21 Versions
  • 0 % Grown

The README.md

Browser for AniDB.net, (*1)

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

Browser for AniDB.net

Read API documentation here: http://wiki.anidb.net/w/HTTP_API_Definition, (*3)

Installation

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

composer require anime-db/ani-db-browser-bundle

Add AnimeDbAniDbBrowserBundle to your application kernel, (*5)

// app/appKernel.php

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

Configuration

# app/config/config.yml

anime_db_ani_db_browser:
    api:
        # API host
        # As a default used 'http://api.anidb.net:9001'
        host: 'http://api.anidb.net:9001'

        # Prefix for API resurces
        # As a default used '/httpapi/'
        prefix: '/httpapi/'

        # API version
        # As a default used '1'
        protover: 1

    # You must register a client and use it here.
    # See for more info:
    #  - http://anidb.net/perl-bin/animedb.pl?show=client
    #  - https://wiki.anidb.net/w/UDP_Clients
    #  - https://wiki.anidb.net/w/UDP_API_Definition
    app:
        # Verion of your client.
        version: 1

        # Your client name.
        # You point it at registration here: http://anidb.net/perl-bin/animedb.pl?show=client
        client: 'my_home_client'

        # Your client code.
        # You will receive it after registration.
        code: 'api-team-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'

Usage

First get a browser, (*6)

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

Get data for anime Seikai no Monshou (wiki):, (*7)

$content = $browser->get(['query' => ['request' => 'anime', 'aid' => 1]]);

Catch exceptions, (*8)

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

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

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

License

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

The Versions

20/05 2014

0.1.1

0.1.1.0 http://github.com/anime-db/ani-db-browser-bundle

Plugin AniDB for the catalog Anime DB

  Sources   Download

GPL-3.0

The Requires

  • php >=5.4.0

 

05/05 2014

0.1.0

0.1.0.0 http://github.com/anime-db/ani-db-browser-bundle

Plugin AniDB for the catalog Anime DB

  Sources   Download

GPL-3.0

The Requires

  • php >=5.4.0