2017 © Pedro Peláez
 

library shikimori-browser-bundle

Plugin Shikimori for the catalog Anime DB

image

anime-db/shikimori-browser-bundle

Plugin Shikimori for the catalog Anime DB

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

The README.md

Shikimori, (*1)

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

Shikimori.org API browser

Read API documentation here: http://shikimori.org/api/doc, (*3)

Installation

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

composer anime-db/shikimori-browser-bundle

Configuration

anime_db_shikimori_browser:
    # API host
    # As a default used 'https://shikimori.org'
    host: 'https://shikimori.org'

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

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

Usage

First get browser, (*5)

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

List animes (docs), (*6)

$animes = $browser->get('animes', ['query' => ['limit' => 10]]);

or, (*7)

$animes = $browser->get('animes?limit=10');

Mark all messages as read (docs), (*8)

$response = $browser->post('messages/read_all');

Update a message (docs), (*9)

$response = $browser->patch('messages/12', [
    'body' => [
        'message' => [
            'body' => 'blablabla',
        ],
    ],
]);

Update a comment (docs), (*10)

$response = $browser->put('comments/8', [
    'body' => [
        'message' => [
            'body' => 'blablabla',
        ],
    ],
]);

Destroy a message (docs), (*11)

$browser->delete('messages/12');

Catch exceptions, (*12)

use AnimeDb\Bundle\ShikimoriBrowserBundle\Exception\NotFoundException;

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

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

License

This bundle is under the MIT license. See the complete license in the file: LICENSE, (*14)

The Versions

05/07 2014

1.0.0

1.0.0.0 http://github.com/anime-db/shikimori-browser-bundle

Plugin Shikimori for the catalog Anime DB

  Sources   Download

GPL-3.0

The Requires

 

04/04 2014

0.1.0

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

Plugin Shikimori for the catalog Anime DB

  Sources   Download

GPL-3.0

The Requires

  • php >=5.4.0